+ Reply to Thread
Results 1 to 9 of 9

Looking for an index match formula that looks at two different columns for a match

  1. #1
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Looking for an index match formula that looks at two different columns for a match

    I have an Index match formula that is looking at sheet1, column C, and matching criteria from sheet2 column E; however, I need it to look at both E and F for matches. I'm thinking I need some kind of "and/or" nested statement, but I'm lost.

    Column C (sheet1) is a combination for ID#'s and license plate numbers, column E (Master trk list linked) is license plate numbers, F(Master trk list linked) is ID#'s. If C, matches E and/or F, it should return column A(Master trk list linked) which is a truck#.

    I can get the value if I only look at one column, but I need it to look at both. The formula below is what I have. Note: in addition I have a wildcard in place because sheet2's values are partial numbers; and I have an IFERROR to return another value if there is no match.

    =IFERROR(INDEX('Master trk list linked'!A:A,(MATCH("*"&RIGHT(C1167,7)&"*",'Master trk list linked'!E:E,0))),"company expense")

    Thanks in advance for your help.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Looking for an index match formula that looks at two different columns for a match

    Try

    =IFERROR(INDEX('Master trk list linked'!A:A,IFERROR(MATCH("*"&RIGHT(C1167,7)&"*",'Master trk list linked'!E:E,0),MATCH("*"&RIGHT(C1167,7)&"*",'Master trk list linked'!F:F,0))),"company expense")

  3. #3
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: Looking for an index match formula that looks at two different columns for a match

    That worked!! Thank you so very much.

  4. #4
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: Looking for an index match formula that looks at two different columns for a match

    Does this formula allow me to look at a third (G) column?

  5. #5
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: Looking for an index match formula that looks at two different columns for a match

    Can I add a third "Match" statement to this formula to look at column (G) or is that too many arguments?

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

    Re: Looking for an index match formula that looks at two different columns for a match

    You would need to introduce another IFERROR, like this:

    =IFERROR(INDEX('Master trk list linked'!A:A,IFERROR(MATCH("*"&RIGHT(C1167,7)&"*",'Master trk list linked'!E:E,0),IFERROR(MATCH("*"&RIGHT(C1167,7)&"*",'Master trk list linked'!F:F,0),MATCH("*"&RIGHT(C1167,7)&"*",'Master trk list linked'!G:G,0)))),"company expense")

    Basically, if it is not in column E try column F and if it is not there try G. If it is in none of them then return "company expense".

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: Looking for an index match formula that looks at two different columns for a match

    Yes, Pete, that worked fantastically. Thank you so very much.

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

    Re: Looking for an index match formula that looks at two different columns for a match

    Glad to help - thanks for the rep.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post and mark this thread as SOLVED.

    Pete

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Looking for an index match formula that looks at two different columns for a match

    Probably a better (simpler?) way would be to use a helper column to combine all those cells into 1 column, then base the MATCH on that?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replies: 4
    Last Post: 04-14-2017, 07:47 PM
  2. INDEX MATCH MATCH multiple columns with same heading
    By djm198 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-11-2016, 02:34 PM
  3. [SOLVED] Cross Check Columns for Index Match Match
    By Harr in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 12-31-2015, 11:35 AM
  4. [SOLVED] Using Index & Match (or similar) to check two columns for a match
    By dvs in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-30-2015, 07:07 PM
  5. [SOLVED] Match Issue - Consolidate Columns of Data With Match/Index/etc?
    By excelsior123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2014, 05:14 PM
  6. Replies: 3
    Last Post: 05-02-2013, 01:31 AM
  7. Replies: 5
    Last Post: 02-29-2012, 08:51 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