+ Reply to Thread
Results 1 to 15 of 15

IF formula looking for two criteria

  1. #1
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    IF formula looking for two criteria

    I need a formula that will return the contents of C1 as long as A1 does not contain the text "Q01" or "C01". The code will be placed in cell D2

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,630

    Re: IF formula looking for two criteria

    Cell D2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: IF formula looking for two criteria

    I tried this formula but i just showed the contents of C1 for everything. Im not sure if it matters but A1 with either contain one or the other, not both.
    Last edited by RaydenUK; 03-03-2015 at 11:57 AM.

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: IF formula looking for two criteria

    The formula is perfect
    This formula would give you value of C1 as long as you dont have Q01 or C01 in A1 ...for any Q01 or C01 in cell A1 it would give a blank
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,630

    Re: IF formula looking for two criteria

    If A1 contains "C01", or A1 contains "Q01" (without quotes), you will get a null return. If it does NOT contain either of those string values, you will get the contents of C1.

    That is what I understood you to be asking for.
    I need a formula that will return the contents of C1 as long as A1 does not contain the text "Q01" or "C01". The code will be placed in cell D2
    Regards, TMS

  6. #6
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: IF formula looking for two criteria

    Ok i fooled around with it and the problem is that i also have other characters in those cells as well, not just C01 or Q01. So if those characters are present anywhere in the cell then do not show C1

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,630

    Re: IF formula looking for two criteria

    The formula does what you asked it to do. We cannot second guess what other data might, or might not, be in the cell.

    Perhaps you need to restate the question.

  8. #8
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: IF formula looking for two criteria

    Yea your right sorry for the confusion. Then the formula does not need to show the contents of C1 if A1 contains within the text "Q01" or "C01". A1 may look like "Q01blahblah" or "C01blah". If so then do not return contents of C1 in D1 where the formula goes.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,630

    Re: IF formula looking for two criteria

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: IF formula looking for two criteria

    HA! perfect! thank you very much and again sorry for the confusion.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,630

    Re: IF formula looking for two criteria

    You're welcome. Thanks for the rep.


    You also said you wanted the formula in cell D2, not that it really matters



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  12. #12
    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: IF formula looking for two criteria

    Or this

    =IFERROR(IF(LOOKUP(2^15,SEARCH({"Q01","C01"},A1)),""),C1)
    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

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,630

    Re: IF formula looking for two criteria

    @AlKey: neat ... and the SEARCH is case insensitive, which may be an advantage.

    Regards, TMS

  14. #14
    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: IF formula looking for two criteria

    Quote Originally Posted by TMS View Post
    @AlKey: neat ... and the SEARCH is case insensitive, which may be an advantage.

    Regards, TMS
    Thank you Trevor

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,630

    Re: IF formula looking for two criteria

    @Alky: you're very welcome; we all learn from each other

+ 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] Vlookup formula with 2 criteria or short if formula
    By dolphino in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-26-2015, 11:56 PM
  2. Replies: 7
    Last Post: 07-07-2014, 09:48 AM
  3. [SOLVED] IF Formula returns #N/A even when criteria if criteria not met
    By Ellice16 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-11-2013, 10:51 PM
  4. SumIF formula with criteria is Text inside a Formula?
    By excellentlearner in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-25-2012, 06:40 PM
  5. Replies: 1
    Last Post: 05-16-2011, 05:00 PM

Tags for this Thread

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