Results 1 to 6 of 6

20150603, 08:39 #1
 Join Date
 Nov 2011
 Location
 Australia
 Posts
 221
 Thanks
 80
 Thanked 3 Times in 2 Posts
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

20150603, 08:49 #2
 Join Date
 Dec 2000
 Location
 Burwash, East Sussex, United Kingdom
 Posts
 6,354
 Thanks
 4
 Thanked 229 Times in 210 Posts
=IF($E$4=C4,B4,if($A$4 ="0",$F$4,""))
Regards,
Rory
Microsoft MVP  Excel

20150603, 09:27 #3
 Join Date
 Nov 2011
 Location
 Australia
 Posts
 221
 Thanks
 80
 Thanked 3 Times in 2 Posts
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

20150603, 09:39 #4
 Join Date
 Dec 2000
 Location
 Burwash, East Sussex, United Kingdom
 Posts
 6,354
 Thanks
 4
 Thanked 229 Times in 210 Posts
I think your description was inverted from the logic you wanted:
=IF($A$4 =0,$F$4,IF($E$4=C4,B4,""))Regards,
Rory
Microsoft MVP  Excel

20150603, 09:44 #5
 Join Date
 Mar 2004
 Location
 Manning, South Carolina
 Posts
 10,014
 Thanks
 423
 Thanked 1,608 Times in 1,452 Posts
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,""))
HTHMay the Forces of good computing be with you!
RG
PowerShell & VBA Rule!
My Systems: Desktop Specs
Laptop Specs

20150603, 10:00 #6
 Join Date
 Nov 2011
 Location
 Australia
 Posts
 221
 Thanks
 80
 Thanked 3 Times in 2 Posts
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 !Last edited by XPDiHard; 20150603 at 10:02.