+ Reply to Thread
Results 1 to 6 of 6

"IF" -function?

  1. #1
    Registered User
    Join Date
    11-08-2007
    Posts
    22

    "IF" -function?

    Hello all,

    I have a small problem with excel.
    I am trying to solve it with "IF" -function but cannot resolve it...lack of skills .

    Problem:

    "Cell A1" can have three different values -> 1, 2 or empty.
    If value in "Cell A1" is 1 then value in "Cell B1" shall be 1.
    If value in "Cell A1" is 2 then value in "Cell B1" shall be -1.
    If value in "Cell A1" is "empty" then value in "Cell B1" shall be "empty".

    Can you please help me with this.
    Thank you in advance!

    Kind regrads,
    J

  2. #2
    Registered User
    Join Date
    08-13-2012
    Location
    Newark, DE
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: "IF" -function?

    =if(a1=1,1,if(a1=2,-1,if(a1="","","???")))
    http://www.mrspreadsheets.com

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: "IF" -function?

    Perhaps:
    Please Login or Register  to view this content.
    * Your profile does not specify Excel Version
    Last edited by protonLeah; 08-15-2012 at 01:02 AM.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    11-08-2007
    Posts
    22

    Re: "IF" -function?

    Thanks for the replies, problem solved with Al Chara's solution!

    J

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: "IF" -function?

    The solution you chose has an unnecessary IF().

    You only need 2: =IF(A1=1,1,IF(A1=2,-1,""))

  6. #6
    Registered User
    Join Date
    08-13-2012
    Location
    Newark, DE
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: "IF" -function?

    Quote Originally Posted by Cutter View Post
    The solution you chose has an unnecessary IF().

    You only need 2: =IF(A1=1,1,IF(A1=2,-1,""))
    I know the OP said that A1 can only have three values (1, 2, or empty), but if for some reason anothe value is returned, then the OP can handle that with the extra IF statement.

+ 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