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...
SergeiBaklan
Mar 31, 2021Diamond Contributor
I only didn't catch why nested IF doesn't work. If use some formatting
=IFS(
G19="Buy", H19*F19*-1,
G19="Sell",H19*F19,
G19="BTO", H19*F19*-100 -I19*F19,
G19="BTC", H19*F19*-100 -I19*F19,
G19="STC", H19*F19*100 -I19*F19,
G19="STO", H19*F19*100 -I19*F19,
TRUE, "wrong value"
)
it's easy to transform IFS back to nested IF
=
IF(G19="Buy", H19*F19*-1,
IF(G19="Sell",H19*F19,
IF(G19="BTO", H19*F19*-100 -I19*F19,
IF(G19="BTC", H19*F19*-100 -I19*F19,
IF(G19="STC", H19*F19*100 -I19*F19,
IF(G19="STO", H19*F19*100 -I19*F19,
"wrong value"
))))))
- PeterBartholomew1Mar 31, 2021Silver ContributorAgreed