+ Reply to Thread
Results 1 to 12 of 12

Match multiple criteria

  1. #1
    Registered User
    Join Date
    06-09-2017
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    5

    Match multiple criteria

    Hello to you all.

    My Spreadsheet is much larger and more complex, but I have trying to simplify this as much as possible to aid in your expertise! So here is my problem...

    Imagine in cell A1 I have 01/01/2018, cell B1 I have 02/01/2018, cell C1 I have 03/01/2018 and in D1 I have 02/01/2018

    In Cell F6 I have 02/01/2018 (just thrown out of the way)

    In cell A2,B2,C2 and D2 is where I want the formula.

    Now I want to return "PMI" if any of the cells in A1, B1, C1 or D1 match the value in cell F6, and nothing if none of them match. I worked out a method to do this with one cell with this formula... =IF(MATCH(F6,B1,0),"PMI","") I hope this makes sense to you, if there is a way to do this, I will be able to transfer the method to my spreadsheet.

    So I should end up with "PMI" in cell B2 and D2

    I have googled and YouTubed with no success and a lot of frustration, and I'm thinking this maybe simpler than I think! I am using Excel 2013.

    If I crack this, my boss will be so pleased!!

    Thanks in advance.

    Jamie
    Last edited by JamiesPhotography; 07-25-2018 at 07:53 AM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078

    Re: Match multiple criteria

    in A2
    =IF(A1=$F6,"PMI","")
    and copy across to D2
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    06-09-2017
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Match multiple criteria

    Thanks, I fear I have not explained my problem as well as originally thought. So I have changed my initial post...


    Imagine in cell A1 I have 01/01/2018, cell B1 I have 02/01/2018, cell C1 I have 03/01/2018 and in D1 I have 04/01/2018

    In Cell F6 I have 02/01/2018 (just thrown out of the way) and cell G6 I have 12/01/18

    In Cell F7 is where I want my formula

    Now I want to return "PMI" if any of the date in F6 matches any of the dates in A1, B1, C1 or D1, and nothing if none of them match. I worked out a method to do this with one cell with this formula... =IF(MATCH(F6,B1,0),"PMI","") I hope this makes sense to you, if there is a way to do this, I will be able to transfer the method to my spreadsheet.

    So I should end up with "PMI" in cell F7 as one of them match

    I want to be able to copy the formula across to G7, where it return nothing as the date in G6 does not match.

    I have googled and YouTubed with no success and a lot of frustration, and I'm thinking this maybe simpler than I think! I am using Excel 2013.

    If I crack this, my boss will be so pleased!!

    Thanks in advance.

    Jamie

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,684

    Re: Match multiple criteria

    in the instance you noted in post #3 I would think this would work...
    =IFERROR(IF(MATCH(F6,A1:D1,0)=MATCH(F6,A1:D1,0),"PMI",""),"")
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078

    Re: Match multiple criteria

    in F7
    =IF(COUNTIF($A1:$D1,F6)>0,"PMI","")
    and copy across

  6. #6
    Registered User
    Join Date
    06-09-2017
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Match multiple criteria

    Quote Originally Posted by Sambo kid View Post
    in the instance you noted in post #3 I would think this would work...
    =IFERROR(IF(MATCH(F6,A1:D1,0)=MATCH(F6,A1:D1,0),"PMI",""),"")
    Thank you for this, the formula didn't work, too many right sided parenthesis with the message too many arguments...but I was able to change it to =IF(MATCH(F6,A1:D1,0),"PMI","") ...can you believe the only thing I was missing was A1:D1, so simple! I think I was trying to over complicate it. Now I know mine returns #N/A when there is not a match and yours was potentially a smarter formula, I'm guessing returning a blank cell when there is no match? But I can hide the #N/A with conditional formatting, and that will work for my needs.

    Thank you so much

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,684

    Re: Match multiple criteria

    well it worked in my representation of your post #3 and I found Special-K's worked as well and was cleaner.
    BUT, glad you got yours adjusted as needed.
    and thank you for the rep!
    Last edited by Sam Capricci; 07-25-2018 at 09:11 AM.

  8. #8
    Registered User
    Join Date
    06-04-2018
    Location
    Europe
    MS-Off Ver
    Office365
    Posts
    79

    Re: Match multiple criteria

    Quote Originally Posted by Sambo kid View Post
    in the instance you noted in post #3 I would think this would work...
    =IFERROR(IF(MATCH(F6,A1:D1,0)=MATCH(F6,A1:D1,0),"PMI",""),"")
    It may be a typo here: MATCH(F6,A1:D1,0)=MATCH(F6,A1:D1,0) this will always be true, so If(.... will be always PMI and IFERROR will not be necessary...

    and this works???

  9. #9
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,684

    Re: Match multiple criteria

    It may be a typo here: MATCH(F6,A1:D1,0)=MATCH(F6,A1:D1,0) this will always be true, so If(.... will be always PMI and IFERROR will not be necessary...

    and this works???
    as the formula was written based off the information in post #3, if I put 1/1/18 in A1, 2/1/18 in B1, 3/1/18 in C1 and 4/1/18 in D1 then put 3/1/18 in F6 and that formula in F7 it returns PMI as requested.
    If I put 3/2/18 in F7, without the additional IFERROR it returns #N/A, with the IFERROR it returns a blank.

  10. #10
    Registered User
    Join Date
    06-04-2018
    Location
    Europe
    MS-Off Ver
    Office365
    Posts
    79

    Re: Match multiple criteria

    Sambo kid,

    Your formula with IF(MATCH(F6,A1:D1,0)=MATCH(F6,A1:D1,0),"PMI","") will be always PMI if MATCH find F6 in that range

    Why not =IF(MATCH(F6,A1:D1,0),"PMI","") with only one MATCH

    or =IFERROR(IF(MATCH(F6,A1:D1,0),"PMI",""),"") to avoid errors

  11. #11
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,684

    Re: Match multiple criteria

    Your formula with IF(MATCH(F6,A1:D1,0)=MATCH(F6,A1:D1,0),"PMI","") will be always PMI if MATCH find F6 in that range
    No it won't, as in the example in post #9, if I put in 3/2/2018 in F6 which falls in the range between 3/1 and 4/1 it will not return PMI.
    Now if you mean that if the value in F6 matches any of the values in A1 through D1 and will return PMI then you are right and that was what the OP wanted unless I misread the request.
    And yours without the IFERROR =IF(MATCH(F6,A1:D1,0),"PMI","") also returns #N/A if the date isn't exact.
    There are many ways to get solutions in excel so your single match works too, I didn't test mine that way but mine works too. I'm not sure of your point otherwise.

  12. #12
    Registered User
    Join Date
    06-04-2018
    Location
    Europe
    MS-Off Ver
    Office365
    Posts
    79

    Re: Match multiple criteria

    MATCH(F6,A1:D1,0)=MATCH(F6,A1:D1,0) is always TRUE (if F6 is in that range A1:D1) or #N/A (if F6 is NOT in that range A1:D1)
    but it is non sense to put a=a or b=b

    Ok, forget it...

+ 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] Index Match with multiple criteria and date criteria
    By snolem75 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2018, 03:51 PM
  2. Replies: 16
    Last Post: 01-05-2018, 11:04 PM
  3. Need help in Index, Match usage to match multiple criteria in sum function
    By Summer0830 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2017, 02:47 AM
  4. Index/Match to Match entries on multiple criteria
    By manning457 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2015, 02:32 PM
  5. [SOLVED] Index Match with Multiple Criteria Using Same Criteria Column
    By rominjn in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-05-2015, 11:34 AM
  6. Replies: 2
    Last Post: 09-27-2014, 04:34 PM
  7. [SOLVED] Index Match using multiple criteria to match to
    By sacastiglia in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-25-2014, 03:46 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