+ Reply to Thread
Results 1 to 12 of 12

IF Statement with multiple criteria

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    IF Statement with multiple criteria

    Morning,

    I have an IF statement that i am using to try populate a cell based on whether a cell contains yes or no.

    If the cell contains Yes i need it to return column A or B depending on which one has an error or not but to look at both A & B in the formula

    Column C is the column with Yes or NO & column D is the column to be populated with the source data

    I've attached a test example.

    Any help would be appreciated
    Last edited by kenadams378; 05-17-2013 at 04:43 AM.

  2. #2
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: IF Statement with multiple criteria

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

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: IF Statement with multiple criteria

    I suppose you want to show the entry which is not in error. If so, use this formula in D2:

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


    then copy down. This will return a blank if both A and B are showing errors, as well as column C not showing "yes".

    By the way, you should set your calculation option on the Formulas tab to Automatic.

    Hope this helps.

    Pete

  4. #4
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: IF Statement with multiple criteria

    Thank you both very much!!

    Really appreciate your time to help

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF Statement with multiple criteria

    Quote Originally Posted by kenadams378 View Post
    Thank you both very much!!

    Really appreciate your time to help
    This is very nice and correct.

    Just a query. In this your own thread...

    http://www.excelforum.com/excel-form...88#post3238488

    ..didn't anyone spend time to helps you?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: IF Statement with multiple criteria

    What would i need to do if there was a 3rd column to look to?

    I've attached a further example

  7. #7
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: IF Statement with multiple criteria

    Bump - No Response

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: IF Statement with multiple criteria

    Not too difficult to extrapolate from what you were given before. Put this in E2:

    =IF(D2="YES",IF(ISERROR(A2),IF(ISERROR(B2),IF(ISERROR(C2),"",C2),B2),A2),"")

    then copy down. Change your calculation option to automatic.

    Hope this helps.

    Pete

  9. #9
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: IF Statement with multiple criteria

    You are a star!!!

  10. #10
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: IF Statement with multiple criteria

    I have one last query if you are able to help,

    I have a similar situation but it uses a lookup too?

    The example i have attached, in the yellow cell this should read no after looking across thge 4 columns to find the data.

    Is it possible to add more than 2 criteria to the formula?

    The formula i have currently is;

    Please Login or Register  to view this content.

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: IF Statement with multiple criteria

    You could do it like this:

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


    but as you are only looking at one column you can use MATCH instead of VLOOKUP like this:

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


    Hope this helps.

    Pete

  12. #12
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: IF Statement with multiple criteria

    Thank you very much again!!

    Very pleased with the result

+ 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