# Thread: Correct syntax for ElseIf formula

1. ## Correct syntax for ElseIf formula

The formula I'm trying to add to is
=IF(\$E\$4=C4,B4,"")
But I need it to go further with a ElseIf

This ain't working
=IF(\$E\$4=C4,B4),elseif(\$A\$4 ="0"),\$F\$4)

How is it suppose to be ?

Thanks

2. =IF(\$E\$4=C4,B4,if(\$A\$4 ="0",\$F\$4,""))

3. Thanks Rory, it don't seem to work.
The formula is in Cell L20

Cell A4 is actually a 0 or 1 type of "switch".
So if it's 1, then the first part of the formula works, if it's 0 then the second If has to show the value
in Cell F4

Thanks

4. I think your description was inverted from the logic you wanted:
=IF(\$A\$4 =0,\$F\$4,IF(\$E\$4=C4,B4,""))

5. XPD,

Rory's formula works you're just testing it wrong.

This has 4 Possibilities:

Possibility 1: If E4=C4 In your example this is True so it displays the value of B4 which is blank or 0.
Possibility 2: If E4<>C4 Then the second IF will be evaluated leading to 3 & 4.
Possibility 3: If A4 = 0 Then display F4
Possibility 4: If A4 <> 0 Then display blank.

All this works as it should of course you do need to remove the "" around the 0!
=IF(\$E\$4=\$C\$4,B4,IF(\$A\$4=0,\$F\$4,""))

HTH

6. I see, had the shoe on the wrong foot !
The RG say's I had the wrong shoes for the right feet, backwards to !

Thnaks !

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•