Not that I ever found... but here's a nice complicated one to help you see the power of the IF statement:
=IF(ISBLANK(A1), 0, IF(A1-B1<=0, 0, IF((D1-C1>365), 0.15 * (A1-B1), 0.25 * (A1-B1))))
Put this into Cell E1 and put dollar amounts into Cells A1, B1, and put Dates into Cells C1, D1.
Here's what it does: it is a triple nested "IF" that checks first to be sure cell A1 is not empty ("ISBLANK(A1)")... if it is empty then it only puts a zero into cell E1, otherwise it puts the value of what is on the rest of the line...
Next... the rest of the line determines if you sold a stock for a gain or a loss (yeah, those dollars amount are going to be stock prices, or actually total amount of money paid and total amount sold - cool, huh?)
The "IF(A1-B1<=0" checks if you sold the stock for a gain or a loss - there is no tax on losses, only if you made money. The second zero after that (A1-B1<=0, 0,) means if there is a loss you will put Zero - change the values of A1 and B1 to be higher or lower than each other and see E1 change from Zero to a value and back to Zero.... still with me?
Good... now: the final part "IF((D1-C1>365)" checks whether you sold the stock as a short term sale or a long term sale (that's greater than 365 days to be long term and pay 15% - or pay your normal tax rate of 25% - you might need to change it to your own tax rate of course).
To see the tax rate part in action change the two Date fields (C1 and D1) to different values that are less than one year or more than one year apart...
Does that help??
...