+ Reply to Thread
Results 1 to 2 of 2

if statements with both and and or options

  1. #1
    Registered User
    Join Date
    01-21-2012
    Location
    united States
    MS-Off Ver
    Excel 2010
    Posts
    17

    if statements with both and and or options

    The problem i have is as follows

    if a1 = 1 and b1 = x c1 = 5
    if a1 =1 and b1 = " " c1 =0
    if a1 = " " b1 1 = " " c1 = " "
    if a1= " " and b1 =x error

    I have not been able to develop the logic to make this work.
    Any help would b appricated.
    Last edited by Genebu; 02-01-2012 at 12:26 PM. Reason: solved

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: if statements with both and and or options

    Hello, there are several ways to do this. Most importantly, not all the options are covered in the four statements above, for example what if A1=2?

    =IF(A1=1,IF(B1="x",5,IF(B1=" ",0,"other")),IF(A1=" ",IF(B1=" "," ",IF(B1="x","error","other"))))

    Or, if A1 can only be 1 or " " and B1 can only be " " or x, then this is shorter:

    =IF(A1=1,IF(B1="x",5,0),IF(B1=" "," ","error"))

    cheers,

+ 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