If you are trying to work out how much the investment contributes to your financial net worth, timing is important. If your taxes are due today and your financial statement says the investment was worth $1000 at the end of the last financial year, and your online account says it is worth $1070 today, then you have something that on paper is worth $1070, for which you need to pay $100 in tax, leaving a notional balance of $1070-$100 = $970 to contribute to your financial net worth.
On the other hand, if you are trying to work out how much tax you need to pay, then you normally use the figure supplied in your financial statement.
Alternatively, if you’re trying to work out some kind of discounted cashflow figure that accumulates provision for tax on a periodic basis, you’d need to factor in your (detailed) profit model as well as the deductions based on the increments you’ve accumulated for tax. An “average 7% return” is probably not going to cut it if you’re going to such detail.
At the other end of the spectrum, you’ve put in $500 and it’s in deep the black even after taxes. So you could say your $500 investment is still worth the $500 you put in, with a fat margin of uncertainty that is currently in your favour.
There are many other alternatives.
So the formula you need depends on what you’re trying to do with the number you’re trying to calculate. Have a discussion with an appropriate financial advisor if you need help working that out. (This answer is not financial advice.)