The IF function
Solved
mike the llama
Posted messages
361
Status
Member
-
mike the llama Posted messages 361 Status Member -
mike the llama Posted messages 361 Status Member -
Hello,
I'm working on a Word file where I inserted a table with some formulas, and there's one I'm struggling with:
In one cell, I need the software to use either of these formulas, depending on the value of the number entered in F5:
IF F5<0 =((F3-F5)/(D1+F4))*100
IF F5>0 =((F3)/(D1+F4+F5))*100
Since I'm not a great specialist in formulas, I tried the following workaround...
=IF(F5<0;((F3-F5)/(D1+F4))*100;IF(F5>0;((F3)/(D1+F4+F5))*100))
...but there seems to be a "SYNTAX ERROR".
Could anyone help me?
Thanks,
mtl
Configuration: Windows 7 / Firefox 48.0
I'm working on a Word file where I inserted a table with some formulas, and there's one I'm struggling with:
In one cell, I need the software to use either of these formulas, depending on the value of the number entered in F5:
IF F5<0 =((F3-F5)/(D1+F4))*100
IF F5>0 =((F3)/(D1+F4+F5))*100
Since I'm not a great specialist in formulas, I tried the following workaround...
=IF(F5<0;((F3-F5)/(D1+F4))*100;IF(F5>0;((F3)/(D1+F4+F5))*100))
...but there seems to be a "SYNTAX ERROR".
Could anyone help me?
Thanks,
mtl
Configuration: Windows 7 / Firefox 48.0
3 answers
I think your code will work better like this:
assuming nothing happens when F5 = 0 ..
Otherwise, with your line: you need to remove your second IF:
which would give IF F5 < 0 then ((F3-F5)/(D1+F4))*100) ; ELSE (F3)/(D1+F4+F5))*100)
assuming nothing happens when F5 = 0 ..
=IF(F5<0,((F3-F5)/(D1+F4))*100,IF(F5>0,((F3)/(D1+F4+F5))*100),"")
Otherwise, with your line: you need to remove your second IF:
IF(F5<0,((F3-F5)/(D1+F4))*100,((F3)/(D1+F4+F5))*100))
which would give IF F5 < 0 then ((F3-F5)/(D1+F4))*100) ; ELSE (F3)/(D1+F4+F5))*100)
The table is extracted from a 3-page Word file that contains a lot of text. I tried inserting an Excel table linked to Word, but it's very impractical in this situation.
My question is about the IF function, which is why I turned to the Excel forum. I didn't think that using this function in Word or Excel would change anything in the formulation of the formula...
Word formulas look like those in Word but there are differences, starting with the language.
In Word, "SI" will be "IF" and 3 arguments are required (If... Else... Then...).
Mod 2: Your formula will therefore look like this:
{=IF(F5>0;((F3)/(D1+F4+F5))*100;{=IF(F5>0;((F3)/(D1+F4+F5))*100;0)})\# "0 %"}
Reminder: the { } are obtained with [CTRL] [F9]. Do not use those from the keyboard and therefore do not copy/paste the formula directly..
C-Claire
Correction :
{=IF(F5<0;((F3+F5)/(D1+F4))*100;{=IF(F5>0;((F3)/(D1+F4+F5))*100;0)}) \# "0 %"}
This is my final word ;-)
C-Claire