I have a cell that I want to calculate this if statement =IF(E7>D7,E7-D7,D7-E7)
but only if the Cell G7 is yes.
I wrote this formula =IF(G7=yes,(IF(E7>D7,E7-D7,D7-E7)),"n/a")
but it doesn't work, how would I fix it?
You could also get the absolute value of the difference:
=IF(G7="yes",ABS(E7-D7), "n/a")
You don't need to add extra brackets for the nested IF statement. Try this:
=IF(G7="yes",IF(E7>D7,E7-D7,D7-E7), "n/a")
#Name
error because inIF(G7=yes
theyes
is without quotes and it must be like"Yes"
or"yes"
. Since it's without quotes, Excel considers it as Reserve word (Function/Command) and Excel does't have any !!