+ Reply to Thread
Results 1 to 5 of 5

Nesting 3 OR statements

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Nesting 3 OR statements

    Hi guys,

    I have the following forumula:

    =IF(ISNUMBER(FIND("XXX",'CORE Data Quarter'!H2)),OR(ISNUMBER(FIND("YYY",'CORE Data Quarter'!H2)),OR(ISNUMBER(FIND("ZZZ",'CORE Data Quarter'!H2))),'CORE Data Quarter'!A2,""))

    What I'm trying to do is that if H2 equals XXX or YYY or ZZZ, then the current cell (current B8) should equal A2. For some reason, I think the formula is only look for XXX and if it does find it its only giving a #VALUE error. I've check the sheet where the results are pulling from and there's defintely a value in A2 which should be the proper result. I had this working with two OR statements, but can't seem to work it with 3.

    Thanks guys!!

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Nesting 3 OR statements

    You may try this formula

    =IF(OR('CORE Data Quarter'!H2={"XXX","YYY","ZZZ"}),A2,"")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Nesting 3 OR statements

    Hi AlKey,

    Thanks for your reply. I tried something similar to that as well, however I need to have the FIND function in the formula as well since XXX YYY and ZZZ are part of a larger text string and I don't believe wildcards work in IF statements. Any other ideas?

    Thanks,

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Nesting 3 OR statements

    It is the way you described it " if H2 equals XXX or YYY or ZZZ". If it is part for the string than it can't be equal.

    Then this


    =IF(OR(ISNUMBER(SEARCH("XXX",'CORE Data Quarter'!H2)),ISNUMBER(SEARCH("YYY",'CORE Data Quarter'!H2)),ISNUMBER(SEARCH("ZZZ",'CORE Data Quarter'!H2))),A2,"")

  5. #5
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Nesting 3 OR statements

    AlKey,

    That worked, thanks very much! Hmm, your formula is very close the the original one I was using with two OR statements. I really only used FIND instead of SEARCH. Thanks very much for your help!

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Nesting 3 OR statements

    You may also use:
    =IF(COUNT(SEARCH({"XXX","YYY","ZZZ"},'CORE Data Quarter'!H2)),A2,"")
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Nesting 3 OR statements

    You're welcome and thank you for your feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Nesting if statements
    By will.girling in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-22-2013, 07:06 AM
  2. Nesting IF OR statements
    By cara13xxi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2013, 12:30 PM
  3. [SOLVED] Nesting IF statements?
    By markthehousebuyer in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-14-2013, 01:59 PM
  4. Nesting IF statements
    By penny in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-03-2007, 04:02 PM
  5. [SOLVED] nesting if statements
    By tjb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-09-2005, 07:05 PM

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