Below is the example of my Excel sheet. In that I want to find the Gain and Loss using the E and D cells. If E>D it should calculate E-D and the value should be entered in F cell and if E
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Enter this formula into cell F2
:
=IF(E2 > D2, E2 - D2, "-")
Then enter this formula into cell G2
:
=IF(E2 <= D2, E2 - D2, "-")
For a row where something is not a gain or a loss, a -
dash will appear in that column.
回答2:
Use the IF() Function.
In the GAIN column, try:
=IF(E2>D2, E2-D2, 0)
In the Loss column, try:
=IF(E2<D2, D2-E2, 0)