Forum Discussion
Nigel_Lewis570202
Sep 02, 2022Copper Contributor
Excel (SWITCH function?)
I wish to show a description next to a couple of sub-totals (e.g let us say that the sub-totals are in cells G50 & H50). I want the description in, say, cell D50 to show the wording "Profit" or "Loss...
- Sep 02, 2022Hans
Thanks, that looks neat - I will try it!
OliverScheurich
Sep 02, 2022Gold Contributor
=IF(AND(G50>0,H50>0),"Profit",IF(AND(G50<0,H50<0),"Loss",IF(AND(G50>0,H50<0),"Profit/(Loss)",IF(AND(G50<0,H50>0),"(Loss)/Profit",""))))
You can apply nested IF as well. An alternative besides SWITCH could be IFS.
- Nigel_Lewis570202Sep 02, 2022Copper ContributorDanke sehr, Quadruple Pawn. I understand the logic of the nested "IF" statements, but they are more involved than I had hoped. Thanks again for your response.