Hello! Welcome to the sixth and final lesson of our first module, "Foundations of the Stock Market."
In our last session, we looked at the big picture by learning how to calculate a company's total value using market capitalization. You learned that Market Cap = Share Price × Outstanding Shares. This helped us classify companies into large-cap, mid-cap, and small-cap, giving us a framework for understanding their general size and stability.
Today, we're going to bring that concept down to a personal level. Instead of valuing the entire company, we'll focus on valuing your piece of it. Our learning outcome for this lesson is to calculate the value of a stock position given the number of shares and price per share.
This is one of the most fundamental and practical skills you'll use as an investor. Every time you log in to a brokerage account, you'll see the value of your holdings fluctuating. Understanding the simple math behind these numbers is the first step toward tracking your own performance and managing your portfolio.
From Company Value to Your Position Value
The calculation for your own holding, or "stock position," uses the exact same logic as market capitalization, just on a different scale.
- Market Capitalization: The value of all shares of a company.
- Position Value: The value of your shares of a company.
The formula is just as straightforward:
Position Value = Number of Shares Owned × Current Price per Share
For example, if you own 20 shares of a company and its stock is currently trading at $150 per share, the value of your position is:
20 shares × $150/share = $3,000
This simple multiplication is the foundation of portfolio tracking.
Cost Basis vs. Current Value: Introducing Unrealized Gains
When you first buy shares, the amount you pay is your cost basis. This is your initial investment.
Cost Basis = Number of Shares Purchased × Price per Share at Purchase
Let's say you bought those 20 shares when the price was only $120 per share. Your cost basis would be:
20 shares × $120/share = $2,400
Now, the stock price is $150. As we calculated, your position is currently worth $3,000. The difference between your position's current value and your original cost basis is your unrealized gain or loss.
- Current Value: $3,000
- Cost Basis: $2,400
- Unrealized Gain: $3,000 - $2,400 = $600
This is an "unrealized" gain because you haven't sold the shares yet. It's a profit that exists only on paper (or on your screen). If the stock price were to fall to $100, you would have an unrealized loss.
The table below illustrates this concept perfectly. It shows a hypothetical position of 500 shares bought at an entry price of $27.57. As the "Close" price changes each day, the "P&L" (Profit & Loss) column tracks the unrealized gain or loss.
:max_bytes(150000):strip_icc()/dotdash_Final_Improve_Your_Investing_With_Excel_Oct_2020-01-704d0365ad1f4892ae49b85a3d7264c9.jpg)
Calculating Your Profit or Loss
To truly understand how to calculate your investment returns, it's essential to distinguish between dollars and percentages, and between unrealized and realized gains.
The following article provides excellent, clear examples of these calculations.
This article from SoFi, titled 'How to Calculate Stock Profit,' breaks down the essential formulas for figuring out your investment returns.
Read the sections 'How Do You Calculate Stock Profit?' and 'Formula to Calculate Percentage Gain or Loss of Stocks'. Pay close attention to the definitions of cost basis, the examples for calculating both profit and loss, and the formula for percentage change.
As you read, you saw two key formulas:
-
Dollar Gain/Loss (Realized):
This is what you calculate after you sell. It's the "real" money you've made or lost.
-
Percentage Gain/Loss:
This is a crucial metric because it allows you to compare the performance of different investments regardless of their share price. A 10% gain is a 10% gain, whether it's on a $10 stock or a $1,000 stock.
Test your understanding!
Imagine you buy 100 shares of a stock at $50 per share. A year later, you sell all 100 shares at $65 per share.
- What was your cost basis for the entire position?
- What was the total value of the sale?
- What is your realized gain in dollars?
- What was your percentage gain?
Show answer
- Cost Basis: 100 shares × $50/share = $5,000
- Sale Value: 100 shares × $65/share = $6,500
- Realized Gain (Dollars): $6,500 - $5,000 = $1,500 (or ($65 - $50) × 100 shares = $1,500)
- Percentage Gain: (($65 - $50) / $50) × 100 = (15 / 50) × 100 = 30%
Putting It All Together: A Practical Worksheet
To make this tangible, let's look at a simple tool you might use to track a hypothetical portfolio.

Let's use this worksheet concept for a final, comprehensive example:
You decide to "buy" two stocks for your hypothetical portfolio:
- Stock A: You buy 15 shares at $200 per share.
- Stock B: You buy 50 shares at $80 per share.
1. Calculate the cost of each position:
- Cost of Stock A: 15 shares × $200/share = $3,000
- Cost of Stock B: 50 shares × $80/share = $4,000
2. Calculate the total initial investment:
- Total Investment = $3,000 + $4,000 = $7,000
- This calculation, adding up the value of multiple positions, is demonstrated in "Activity 2A: Add ‘Em Up" in the MATH BEHIND THE MARKET resource.
Now, let's fast forward a few months. The prices have changed:
- Stock A is now at $230 per share.
- Stock B is now at $75 per share.
3. Calculate the current value of each position and your unrealized gain/loss:
- Stock A:
- Current Value: 15 shares × $230/share = $3,450
- Unrealized Gain: $3,450 (Current Value) - $3,000 (Cost) = +$450
- Stock B:
- Current Value: 50 shares × $75/share = $3,750
- Unrealized Loss: $3,750 (Current Value) - $4,000 (Cost) = -$250
Your brokerage account would automatically do these calculations, but now you understand exactly what the numbers mean.
Conclusion
This lesson completes our foundational module. You've learned the essential math needed to track your investments, from valuing an entire company down to your personal stake in it.
Here are the key takeaways:
- The value of your stock position is calculated by multiplying the number of shares you own by the current stock price.
- Your cost basis is the total amount you paid for your shares.
- The difference between the current value and your cost basis is your unrealized gain or loss.
- A gain or loss becomes realized only when you sell your shares.
- Calculating returns as a percentage helps you compare the performance of different investments equally.
You now have the core vocabulary and concepts needed to understand the market. In our next module, "Setting Up Your Investment Hub," we will transition from theory to practice. The very first step will be learning how to select a brokerage firm—the platform you will use to actually buy and sell stocks.