+ Reply to Thread
Results 1 to 6 of 6

Problem with Index and Match

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Problem with Index and Match

    Morning, Gurus. I've used this formula (garnered from the geniuses on this site) to vlookup data from one sheet to another if 2 criteria were met, and it worked in that instance. Now I am trying to edit the formula to work in a different workbook, with different columns, and seem to be having trouble with the edits.

    I have two worksheets with the same column headings, but the data may be different. I am trying to compare the price in one sheet, (Key), with the price in the sheet where I am entering the formula, (CanKey). I have attached a sample of the workbook, after removing sensitive data. Here is the formula I am entering in column J2 of my CanKey worksheet to return the cost from the Key worksheet (Column I) if the vendor number (Column G) and the product number (Column A) match:

    Please Login or Register  to view this content.
    Not sure what I am doing wrong. Any help will be greatly appreciated.

    Have a good one.
    Attached Files Attached Files
    Last edited by [email protected]; 04-25-2015 at 12:13 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Problem with Index and Match

    Try this Array Formula. They're a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...

    However, it will return only blanks, as there are NO matching values in your example.

    =IFERROR(INDEX(Key!$I$1:$I$10,MATCH(A2&G2,Key!$A$1:$A$10&Key!$G$1:$G$10,0)),"")
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    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: Problem with Index and Match

    There are NO matches found in column G. If you make correction you can use this non-array version

    =IFERROR(INDEX(Key!$I$2:$I$10,MATCH(A2&G2,INDEX(Key!$A$2:$A$10&Key!$G$2:$G$10,0),0)),"")
    Last edited by AlKey; 04-25-2015 at 11:38 AM.
    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

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Problem with Index and Match

    Thanks, Glenn. Apparently I'm an idiot. I had forgotten that we had different vendor ID numbers in the 2 different systems from which I drew my data, and didn't change the vendor ID numbers to match. That's why my formula was returning #N/A. Once I fixed the vend ID numbers my original formula worked, I didn't even have to enter it as an array. Hard to believe how slow it was to calculate though, since my full data was over 77,000 lines. One I ran the formula down the whole page it took about 10 minutes to calculate for all the rows. Must be the index portion that makes it so slow.

    I appreciate the help and quick reply. You are a lifesaver. This question is SOLVED!

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Problem with Index and Match

    Sorry, Al. Messages must have crossed. Thanks for the reply, and like you I decided to go with the non-array. In my case it is just because I still don't fully understand arrays.

    I appreciate the help, guys. Absolutely LOVE this forum.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Problem with Index and Match

    Quote Originally Posted by [email protected] View Post
    Hard to believe how slow it was to calculate though, since my full data was over 77,000 lines. One I ran the formula down the whole page it took about 10 minutes to calculate for all the rows. Must be the index portion that makes it so slow.
    Range concatenation is very inefficient.

    Range1&Range2 =
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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 Match - syntax problem
    By Dabooka in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-01-2014, 09:05 AM
  2. [SOLVED] need help...problem index/match
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-19-2013, 03:34 AM
  3. Replies: 6
    Last Post: 05-28-2013, 05:08 PM
  4. index/match problem
    By pma85 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 05-23-2013, 04:37 PM
  5. Problem with INDEX, INDIRECT, MATCH, MATCH
    By JO505 in forum Excel General
    Replies: 5
    Last Post: 09-01-2011, 05: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