Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    221
    Thanks
    80
    Thanked 3 Times in 2 Posts

    Formula with 2 IF's and 3rd statement instead of 0 ending

    I am trying to write a formula that "forces" one to choose either one of the other.
    It's an "On" or "Off" formula when either a 1 or a 0 is a *must* in the cell range
    The 1 or 0 is for a macro's "If Then" VBA code



    =IF(G3="0","On"), IF(G3="1","Off", "please enter 1 or 0 in Cell G3")

    All I get is; #VALUE!
    The Formula goes in Merged cells H3 and I3

    What is the correct syntax ?

    Thanks
    Last edited by XPDiHard; 2015-07-23 at 09:15.

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    Your closing parenthesis is in the wrong place:
    =IF(G3="0","On", IF(G3="1","Off", "please enter 1 or 0 in Cell G3"))
    though if the cell should contain a numeric 1/0 rather than "1"/"0", you should use:
    =IF(G3=0,"On",IF(G3=1,"Off", "please enter 1 or 0 in Cell G3"))
    Regards,
    Rory

    Microsoft MVP - Excel

  3. The Following User Says Thank You to rory For This Useful Post:

    XPDiHard (2015-07-23)

Posting Permissions

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