• Correct syntax for ElseIf formula

    • This topic has 5 replies, 3 voices, and was last updated 10 years ago.
    Author
    Topic
    #500257

    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

    Viewing 4 reply threads
    Author
    Replies
    • #1507762

      =IF($E$4=C4,B4,if($A$4 =”0″,$F$4,””))

    • #1507766

      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

    • #1507768

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

    • #1507769

      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 E4C4 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!
      [noparse]=IF($E$4=$C$4,B4,IF($A$4=0,$F$4,””))[/noparse]

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1507770

      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 !

    Viewing 4 reply threads
    Reply To: Correct syntax for ElseIf formula

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: