+ Reply to Thread
Results 1 to 9 of 9

"IF" statement, 2 in 1 cell or combined

Hybrid View

  1. #1
    Registered User
    Join Date
    04-29-2007
    Posts
    10

    "IF" statement, 2 in 1 cell or combined

    I have the following statement in cell E8:

    =IF(A1=1,"ON","") So if A1 has 1 in it then E8 displays ON otherwise nothing

    I would Also like to add the following to E8:

    =IF(A1=0,"","OFF") So if A1 has 0 in it then E8 displays OFF otherwise nothing

    How do u add two "IF" statements to one cell? Or is it possible to combine the above two. 1=ON, 0=OFF, Empyty = Empty

    Thanks

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    =if(a1=1,"on",if(a1=0,"off",""))

    ie make the second if the negative outcome of the first
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    04-29-2007
    Posts
    10
    Quote Originally Posted by sweep
    =if(a1=1,"on",if(a1=0,"off",""))

    ie make the second if the negative outcome of the first
    I tried that its works for 1 and 0 but if A1 is empty still displays "off" and i need the target cell to display empty if a1 is empty also I tried:

    =IF(A1=1,"on",IF(A1=0,"off", IF(A1<>"","")))

    but same prob as above.

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    A third if then!!!

    =IF(A1<>"",IF(A1=1,"on",IF(A1=0,"off","")),"")

  5. #5
    Registered User
    Join Date
    04-29-2007
    Posts
    10
    Quote Originally Posted by sweep
    A third if then!!!

    =IF(A1<>"",IF(A1=1,"on",IF(A1=0,"off","")),"")
    woot that works thank you, I started messing with a nested OR statement but couldnt figure that out.

  6. #6
    Registered User
    Join Date
    11-08-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: "IF" statement, 2 in 1 cell or combined

    Hi,

    want ot combine two if condition how do i do?

    if value is less than one then +1 or if value is greater than or equal to 1 then value remain same. Conditions are =IF(A27<1,A27+1),IF(A27>=1,A27)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1