Close Menu

    Subscribe to Updates

    Get the latest news from tastytech.

    What's Hot

    Subscription Plans and Core Features Explained

    February 10, 2026

    Chinese AI Models Power 175,000 Unprotected Systems as Western Labs Pull Back

    February 10, 2026

    How to Learn AI for FREE in 2026?

    February 10, 2026
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    tastytech.intastytech.in
    Subscribe
    • AI News & Trends
    • Tech News
    • AI Tools
    • Business & Startups
    • Guides & Tutorials
    • Tech Reviews
    • Automobiles
    • Gaming
    • movies
    tastytech.intastytech.in
    Home»Business & Startups»7 Ways to Build Investment Portfolio Tracker in Excel
    7 Ways to Build Investment Portfolio Tracker in Excel
    Business & Startups

    7 Ways to Build Investment Portfolio Tracker in Excel

    gvfx00@gmail.comBy gvfx00@gmail.comNovember 5, 2025No Comments11 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Managing stocks and ETFs across accounts gets messy fast, and guessing your gains or sector exposure is no way to invest. Centralize everything, track real performance, and get notified when something needs your attention instead of reacting late. This guide walks you through pulling live stock prices, calculating gains and losses, monitoring sector exposure, and setting alerts for meaningful price changes. And here’s the thing: this comprehensive guide will show you how to build an investment portfolio tracker in Excel to monitor all your holdings in one place and send automated email alerts for significant market moves.

    Table of Contents

    Toggle
    • 1. Design The Column Structure 
    • 2. Fill in Sample Data 
    • 3. Getting Live Stock Prices 
    • 4. Building Smart Calculation Formulas 
    • 5. Build A Summary Dashboard 
    • 6. Creating Visual Alerts with Conditional Formatting 
    • 7. Set up Automated Email Alerts 
      • Best Practices for Maintenance 
    • Conclusion 
    • Frequently Asked Questions
        • Login to continue reading and enjoy expert-curated content.
      • Related posts:
    • How Conversational Chatbots Can Revolutionize Your Sales Process
    • A Way To Explain How Your AI Model Works
    • How to Vibe Code on a Budget

    1. Design The Column Structure 

    Open MS Excel and decide on the column structure based on the investment details you want to track. Fill in the header rows. I have used the structure below: 

    A1: Symbol - Stock ticker (AAPL, MSFT, SPY) 

    B1: Company Name - Full company/fund name 

    C1: Asset Type - Stock, ETF, Bond, Crypto 

    D1: Shares - Number of shares owned 

    E1: Avg Cost - Average purchase price per share 

    F1: Total Cost - Total investment amount 

    G1: Current Price - Live market price (auto-updated) 

    H1: Market Value - Current total value 

    I1: Gain/Loss $ - Profit or loss in dollars 

    J1: Gain/Loss % - Return percentage 

    K1: Sector - Industry sector (Technology, Healthcare, etc.) 

    L1: Notes - Purchase date, strategy notes

    2. Fill in Sample Data 

    Insert a sample of 20 diverse stock and ETF holdings across multiple sectors. Include technology stocks, financial services, healthcare, consumer goods, energy, and index ETFs to create a diversified portfolio. Leave Columns F through J empty initially, as they will be filled automatically with formulas in the upcoming steps. 

    Sample Holdings: 

    Sample data on Excel

    3. Getting Live Stock Prices 

    Now we’ll set up automatic price feeds. Excel Desktop has multiple methods, but we’ll use the most reliable approach for consistent results. 

    Method 1: Using Stock Data Types  

    Follow the following steps below: 

    1. Select ticker symbols in column A (A2:A21) 
    2. Go to Data tab  
    3. Click Stocks button 
    4. Wait for conversion (10-15 seconds for all 20 stocks) 
    5. Verifyy success by seeing a small icon next to each ticker 

    Extract Current Price in Column G: 

    Click cell G2 and enter this formula: =A2.Price 

    This extracts the live current price from the Stock data type. Copy this formula down to G3:G21.

    Current prices of the stocks

    Method 2: Alternative Solution for Compatibility Issues 

    Sometimes the “STOCK” Function in excel depends upon the latest version and geography. If Stock data types don’t work on your system, use this STOCKHISTORY function: 

    Click cell G2 and enter: =INDEX(STOCKHISTORY(A2,TODAY()-1,TODAY()),1,5) 

    This pulls the most recent closing price. Copy down to G3:G21. 

    4. Building Smart Calculation Formulas 

    Now we’ll add formulas to automatically calculate your investment performance. These formulas update instantly whenever prices change. 

    A. Total Cost Formula (Column F) 

    Click cell F2 and enter this formula: =D2*E2 

    This calculates: Shares × Average Cost = Total Investment 

    Copy this formula down to F3:F21. 

    B. Market Value Formula (Column H) 

    Click cell H2 and enter this formula: =D2*G2 

    This calculates: Shares × Current Price = Current Market Value 

    Copy down to H3:H21. 

    C. Gain/Loss in Dollars (Column I) 

    Click cell I2 and enter this formula: =H2-F2 

    This calculates: Market Value – Total Cost = Profit/Loss 

    Copy down to I3:I21. 

    D. Gain/Loss Percentage (Column J) 

    Click cell J2 and enter this formula: =IF(F2=0,0,(I2/F2)*100) 

    Then format column J as Percentage  

    This calculates: (Gain/Loss ÷ Total Cost) = Return Percentage 

    Copy down to J3:J21. 

    5. Build A Summary Dashboard 

    Add a portfolio summary section starting at row 24 to track key metrics: 

    A. Total Portfolio Value (In USD) 

    Add this formula to calculate total current value: =SUM(H2:H21) 

    B. Total Cost Basis (In USD) 

    Add this formula to calculate total investment: =SUM(F2:F21) 

    C. Total Gain/Loss ($) 

    Add this formula to calculate total profit/loss: =B27-B28 

    (Assuming B27 has portfolio value and B28 has cost basis) 

    D. Total Return (%) 

    Add this formula to calculate overall return percentage: =(B29/B28) 

    E. Number of Holdings 

    Add this formula to count active positions: =COUNTA(A2:A21) 

    F. Best Performer 

    Add this formula to identify top gainer: =INDEX(A2:A21,MATCH(MAX(J2:J21),J2:J21,0)) 

    G. Worst Performer 

    Add this formula to identify biggest loser: =INDEX(A2:A21,MATCH(MIN(J2:J21),J2:J21,0)) 

    Portfolio Summary

    6. Creating Visual Alerts with Conditional Formatting 

    Now set up conditional formatting to highlight significant movements and performance: 

    Format Gain/Loss $ Column (I): 

    1. Select column I (I2:I21) 
    2. Go to Home : Conditional Formatting : New Rule 
    3. Format cells > 0: Light green fill with dark green text 
    4. Add another rule for < 0: Light red fill with dark red text 

    Format Gain/Loss % Column (J): 

    Repeat the same green/red formatting process for column J. 

    Add Data Bars to Market Value (Column H): 

    1. Select H2:H21 
    2. Conditional Formatting : Data Bars : Blue Gradient Fill 

    This creates visual bars showing the relative size of each position. 

    Now your tracker will automatically highlight gains in green and losses in red, making it easy to spot performance at a glance. 

    Adding bars to market value

    7. Set up Automated Email Alerts 

    Since Excel Desktop doesn’t have built-in email automation, we’ll use Google App Script for automated email alerts. 

    Steps for Setting Up Google Apps Script: 

    1. Export to CSV: From Excel, save as CSV 
    2. Upload to Google Sheets: Import the CSV file 
    3. Add GOOGLEFINANCE: Replace column G with =GOOGLEFINANCE(A2,"price") 
    4. Access Apps Script: In Google Sheets, go to Extensions : Apps Script 
    5. Delete Default Code: Remove existing code 
    6. Rename Project: Click “Untitled project” and rename to “Portfolio Alerts” 

    Paste this complete script into the Code.gs file: 

    function checkStockAlerts() { 
    
     const sheet = SpreadsheetApp.getActiveSheet(); 
    
     const data = sheet.getDataRange().getValues(); 
    
     const headers = data[0]; 
    
      // Find column indices 
    
     const symbolCol = headers.indexOf('Symbol'); 
    
     const companyCol = headers.indexOf('Company Name'); 
    
     const priceCol = headers.indexOf('Current Price'); 
    
     const dayChangeCol = headers.indexOf('Day Change %'); 
    
     const gainLossCol = headers.indexOf('Gain/Loss %'); 
    
     const sharesCol = headers.indexOf('Shares'); 
    
     const marketValueCol = headers.indexOf('Market Value'); 
    
      let alerts = []; 
    
      // Loop through each row (skip header) 
    
     for (let i = 1; i < data.length; i++) { 
    
       const symbol = data[i][symbolCol]; 
    
       const company = data[i][companyCol]; 
    
       const currentPrice = data[i][priceCol]; 
    
       const dayChange = data[i][dayChangeCol]; 
    
       const gainLoss = data[i][gainLossCol]; 
    
       const shares = data[i][sharesCol]; 
    
       const marketValue = data[i][marketValueCol]; 
    
       // Skip if no symbol 
    
       if (!symbol) continue; 
    
       // Alert if day change > 5% or < -5% 
    
       if (Math.abs(dayChange) >= 5) { 
    
      alerts.push({ 
    
        symbol: symbol, 
    
        company: company, 
    
        type: 'Daily Movement', 
    
        message: `$ Value: $1,000.00' 
    
        ($ 
    
      symbol: 'TEST', 
    
      company: 'Test Company', 
    
      type: 'Daily Movement', 
    
      message: 'TEST: 5.5% day change (This is a test)', 
    
      details: 'Current Price: $100.00 ): $ Shares: 10 % day change`, 
    
        details: `Current Price: $ Value: $1,000.00' 
    
        | Shares: ${shares} | Value: ${marketValue.toFixed(2)}` 
    
      }); 
    
       } 
    
       // Alert if gain/loss milestone reached 
    
       if (gainLoss >= 50) { 
    
      alerts.push({ 
    
        symbol: symbol, 
    
        company: company, 
    
        type: 'Profit Milestone', 
    
        message: `${symbol}: +${gainLoss.toFixed(2)}% gain reached!`, 
    
        details: `Current Price: ${currentPrice.toFixed(2)} | Position Value: ${marketValue.toFixed(2)}` 
    
      }); 
    
       } else if (gainLoss <= -20) { 
    
      alerts.push({ 
    
        symbol: symbol, 
    
        company: company, 
    
        type: 'Loss Warning', 
    
        message: `${symbol}: ${gainLoss.toFixed(2)}% loss alert`, 
    
        details: `Current Price: ${currentPrice.toFixed(2)} | Position Value: ${marketValue.toFixed(2)}` 
    
      }); 
    
       } 
    
     } 
    
      // Send email if alerts exist 
    
     if (alerts.length > 0) { 
    
       sendAlertEmail(alerts); 
    
       Logger.log('Alert email sent with ' + alerts.length + ' alert(s)'); 
    
     } else { 
    
       Logger.log('No alerts to send at this time'); 
    
     } 
    
    } 
    
    function sendAlertEmail(alerts) { 
    
     // CHANGE THIS TO YOUR EMAIL ADDRESS 
    
     const emailAddress="[email protected]"; 
    
      // Build email subject 
    
     const subject="🚨 Stock Alert: " + alerts.length + ' Position(s) Require Attention'; 
    
      // Build email body 
    
     let body = 'Portfolio Alert Summary\n'; 
    
     body += '═══════════════════════════\n\n'; 
    
      // Group alerts by type 
    
     const dailyMovement = alerts.filter(a => a.type === 'Daily Movement'); 
    
     const profitMilestones = alerts.filter(a => a.type === 'Profit Milestone'); 
    
     const lossWarnings = alerts.filter(a => a.type === 'Loss Warning'); 
    
      // Daily movement alerts 
    
     if (dailyMovement.length > 0) { 
    
       body += '📊 SIGNIFICANT DAILY MOVEMENTS:\n\n'; 
    
       dailyMovement.forEach(alert => { 
    
      body += alert.message + '\n'; 
    
      body += alert.details + '\n\n'; 
    
       }); 
    
     } 
    
      // Profit milestone alerts 
    
     if (profitMilestones.length > 0) { 
    
       body += '💰 PROFIT MILESTONES:\n\n'; 
    
       profitMilestones.forEach(alert => { 
    
      body += alert.message + '\n'; 
    
      body += alert.details + '\n\n'; 
    
       }); 
    
     } 
    
      // Loss warning alerts 
    
     if (lossWarnings.length > 0) { 
    
       body += '⚠️ LOSS WARNINGS:\n\n'; 
    
       lossWarnings.forEach(alert => { 
    
      body += alert.message + '\n'; 
    
      body += alert.details + '\n\n'; 
    
       }); 
    
     } 
    
      // Add footer 
    
     body += '═══════════════════════════\n'; 
    
     body += 'Alert generated: ' + new Date().toLocaleString() + '\n'; 
    
     body += 'Check your portfolio tracker for full details.\n'; 
    
      // Send the email 
    
     try { 
    
       GmailApp.sendEmail(emailAddress, subject, body); 
    
     } catch (error) { 
    
       Logger.log('Error sending email: ' + error); 
    
     } 
    
    } 
    
    function testEmailAlert() { 
    
     // Test function to verify email works 
    
     const testAlerts = [ 
    
       { 
    
      symbol: 'TEST', 
    
      company: 'Test Company', 
    
      type: 'Daily Movement', 
    
      message: 'TEST: 5.5% day change (This is a test)', 
    
      details: 'Current Price: $100.00 | Shares: 10 | Value: $1,000.00' 
    
       } 
    
     ]; 
    
      sendAlertEmail(testAlerts); 
    
     Logger.log('Test email sent'); 
    
    }

    Important: Next to const emailAddress = Replace [email protected] with your Gmail address. 

    Authorize and Test the Script: 

    1. Save the script (press Ctrl+S or Cmd+S) 
    2. Select function: Choose testEmailAlert from dropdown 
    3. Click Run button 
    4. Grant permissions when prompted: 
    • Click “Review permissions” 
    • Choose your Google account 
    • Click “Advanced” : “Go to [Project Name] (unsafe)” 
    • Click “Allow” 
    1. Check your email for the test message 
    Edit trigger for portfolio alerts

    Set Up Automatic Trigger: 

    1. Click the Clock icon in the left sidebar (Triggers) 
    2. Click “+ Add Trigger” 
    3. Configure trigger: 
    • Function: checkStockAlerts 
    • Event source: Time-driven 
    • Type: Hour timer 
    • Interval: Every hour (or your preference)
    1. Click Save 
    Portfolio Alert Summary

    Best Practices for Maintenance 

    Here are some pointers you can follow to keep your investment tracker running smoothly: 

    • Weekly Review: Open tracker and review performance, check email alerts from the past week & note any significant changes 
    • Quarterly Analysis: Review sector allocation, assess individual holdings performance and consider rebalancing opportunities 
    • Annual Audit: Generate annual performance report, export transactions for tax preparation & review and update investment strategy 

    Conclusion 

    With multiple investment accounts and dozens of stocks it can be difficult to keep track of your complete portfolio performance. However, now with the help of this Excel tracker with live data feeds, you can be on top of your investments and make informed decisions. With the help of this knowledge, you can now: 

    1. Build a comprehensive investment tracker in Excel Desktop with live stock prices 
    2. Automate calculations for gains, losses, and returns across all positions 
    3. Set up automated email alerts using Google Apps Script for significant price movements 
    4. Track transactions and maintain accurate cost basis for tax purposes 
    5. Monitor portfolio performance across multiple sectors and asset classes 

    With this system, you’ll never lose track of your investment performance again and can make informed decisions based on real-time data and comprehensive analytics.

    Read more:

    Frequently Asked Questions

    Q1. Should I use Excel Desktop or Excel Online for this tracker?

    A. Excel Desktop is strongly recommended for the best experience. It has full Stock data type support for automatic live price feeds. Excel Online has limitations with live data. If you don’t have Excel Desktop, Google Sheets is a better free alternative than Excel Online, as GOOGLEFINANCE works reliably worldwide. 

    Q2. How many stocks can this tracker handle? 

    A. The tracker can easily handle 100+ stocks. Excel Desktop performs well with 200+ holdings. Google Sheets handles 1,000+ stocks smoothly. For optimal performance, keep under 200 holdings in Excel, or consider splitting into multiple sheets by account type. 

    Q3. I’m seeing unrealistic percentages like 6510% in Gain/Loss %. How do I fix this? 

    A. This error occurs when: 
    1. The Total Cost formula (Column F) isn’t working: Ensure F2 = =D2*E2 
    2. Wrong formula in Gain/Loss %: Should be =IF(F2=0,0,I2/F2) not I2/E2 
    3. Double percentage multiplication: If using Percentage format, remove *100 from formula 


    Sohan Sethi

    Sohan Sethi is a Data Analytics Manager and Content creator passionate about using data, technology, and storytelling to create meaningful impact. With experience in healthcare, analytics, and workflow automation, he has built tools and platforms that streamline processes for thousands of users, combining technical expertise in SQL, Python, Excel, SharePoint, and Power Platform with a people-first approach to problem-solving.
    Beyond his professional career, Sohan is dedicated to empowering job seekers and international students through free resources, mentorship, and thought leadership. He has given a TEDx talk and featured in multiple media platforms including Business Insider, CNBC, Fox News, etc. He regularly shares strategies on job search, career growth, and adapting to challenges. His work has inspired professionals worldwide to unlock opportunities and reach their goals.

    Login to continue reading and enjoy expert-curated content.

    Related posts:

    GPU vs TPU: What’s the Difference?

    What is Microsoft Agent Framework? [5 Minutes Overview]

    Prompt Engineering Guide 2026

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleScientists observed a black hole flare that ‘shined with the light of 10 trillion suns’
    Next Article 5 Underrated BMW Paint Colors That Deserve More Attention
    gvfx00@gmail.com
    • Website

    Related Posts

    Business & Startups

    How to Learn AI for FREE in 2026?

    February 10, 2026
    Business & Startups

    Claude Code Power Tips – KDnuggets

    February 9, 2026
    Business & Startups

    Why Industries Need Custom AI Tools?

    February 9, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    BMW Will Put eFuel In Cars Made In Germany From 2028

    October 14, 202511 Views

    Best Sonic Lego Deals – Dr. Eggman’s Drillster Gets Big Price Cut

    December 16, 20259 Views

    What is Fine-Tuning? Your Ultimate Guide to Tailoring AI Models in 2025

    October 14, 20259 Views
    Stay In Touch
    • Facebook
    • YouTube
    • TikTok
    • WhatsApp
    • Twitter
    • Instagram

    Subscribe to Updates

    Get the latest tech news from tastytech.

    About Us
    About Us

    TastyTech.in brings you the latest AI, tech news, cybersecurity tips, and gadget insights all in one place. Stay informed, stay secure, and stay ahead with us!

    Most Popular

    BMW Will Put eFuel In Cars Made In Germany From 2028

    October 14, 202511 Views

    Best Sonic Lego Deals – Dr. Eggman’s Drillster Gets Big Price Cut

    December 16, 20259 Views

    What is Fine-Tuning? Your Ultimate Guide to Tailoring AI Models in 2025

    October 14, 20259 Views

    Subscribe to Updates

    Get the latest news from tastytech.

    Facebook X (Twitter) Instagram Pinterest
    • Homepage
    • About Us
    • Contact Us
    • Privacy Policy
    © 2026 TastyTech. Designed by TastyTech.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.