+ Reply to Thread
Results 1 to 6 of 6

If and or formula

  1. #1
    Registered User
    Join Date
    11-06-2008
    Location
    memphis, tn
    MS-Off Ver
    2010
    Posts
    16

    If and or formula

    Hi all,

    Need some help with if-and-or statement if possible. The formula would go in cell A10.
    If D5="x" and D4=7, answer would be "H8", if D4 is blank, answer would be "x".
    If D5=2 or 3, and D4=7, answer would be "H8", if D4 is blank, answer would be "v8".
    If D5=1 or blank and D4=7 or blank, answer would be " ".

    Thanks in advance for any help you might be able to offer.
    Steve
    Last edited by sd7000; 11-15-2009 at 10:15 AM.

  2. #2
    Forum Contributor
    Join Date
    12-02-2008
    Location
    India
    Posts
    118

    Re: If and or formula

    Hey!
    Try this...

    =IF(AND(D4=7,D5="X"),"H8",IF(AND(D4="",D5="X"),"X",IF(AND(D4=7,OR(D5=2,D5=3)),"H8",IF(AND(D4="",OR(D5=2,D5=3)),"V8",IF(AND(D4=7,OR(D5=1,D5="")),"","VALUE NOT FOUND")))))

    Lengthy formula... dont know wot u want if none of the conditions match, so i added "value not found" at the end, u cud change that to wotever u like...

    Hope it works out for u..

    Regards
    Mohit

  3. #3
    Forum Contributor
    Join Date
    12-02-2008
    Location
    India
    Posts
    118

    Re: If and or formula

    Hey!
    Just for fun, i tried this other way and it worked too... all the blanks would have to infact be spaces " " for the formula to work though.... and u'd need to use and hide 3 reference columns...

    Have a look! :P

    Regards
    Mohit
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If and or formula

    Hi Steve,

    There are two D4=blank with different requirements. Which takes precedence?
    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    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 and or formula

    Hi,

    this formula

    =IF(OR(ISBLANK(D5),D5=1),"",IF(D5="x",IF(D4=7,"H8","x"),IF(D4=7,"H8","V8")))

    will work, but you'd need to ensure that only valid entries can be made in D4 and D5

    This formula

    =INDEX({"","","H8","H8","H8";"","","V8","V8","x"},MATCH(D4,{7,0},0),MATCH(D5,{0,1,2,3,"x"},0))

    will work and produce #N/A if D4 is something other than blank or 7, or D5 is something other than blank, 1, 2, 3 or x. It's not quite perfect, though, since it will treat blanks the same as zeros in D4 and D5, so, again you may want to make sure that data input is validated.

    hth

  6. #6
    Registered User
    Join Date
    11-06-2008
    Location
    memphis, tn
    MS-Off Ver
    2010
    Posts
    16

    Re: If and or formula

    Thanks for all the help, I did a little adjusting, formulas work great, thanks again.

+ 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