Forum Discussion
BradH5
Mar 30, 2021Copper Contributor
Need help with multiple IFs formula
I can't do this with a traditional IF formula. So, I've been trying to work out the IFS formula. It seems this should work but, something is off somewhere: =IFS(G19="Buy", ((H19*F19)*-1), G19="Se...
PeterBartholomew1
Mar 30, 2021Silver Contributor
The formula appears valid. You could also use
= SWITCH(G19,
"Buy", ((H19*F19)*-1),
"Sell", (H19*F19),
"BTO", ((H19*F19)*-100)-(I19*F19),
"BTC", ((H19*F19)*-100)-(I19*F19),
"STC", ((H19*F19)*100) -(I19*F19),
"STO", ((H19*F19)*100) -(I19*F19))I wouldn't know whether 'something is a bit off' since I have no idea what you expect or what F19, H19 and I19 might contain. G19 seems to be codes that have something to do with trading but why "STO" appears to be out of order or why it does not deserve a minus sign, I cannot even guess.
BradH5
Mar 30, 2021Copper Contributor
Unfortunately, I get the same "#Name?" error with the switch formula as i do with the IFS formula I posted.
- Detlef_LewinMar 31, 2021Silver Contributor
IFS() and SWITCH() are available since Excel 2019.