+ Reply to Thread
Results 1 to 12 of 12

I get an error in (Index & Match) Formula

  1. #1
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    106

    I get an error in (Index & Match) Formula

    Dear `s
    In the attached file I have 2 sheet, the first sheet name is SETUP and the second sheet is Data, in the SETUP sheet I highlighted column E2 from (E2:E40) to be my index data and I build my formula in second sheet, and it works fine except that It not showing the right index when the figure become >3 or >4 or >5 & >10 it showing #N/A.

    Please in need your support & help to solve this error. I don’t need to use IF condition because the variables in this data is more than 80 records for each country.

    BR
    Attached Files Attached Files
    Last edited by MAHMUZ; 11-14-2010 at 05:33 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Index & Match Formula

    Hi mahmuz, please adopt your title according to the ruels:

    1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change the title of the thread, click EDIT on the original post, then click the Go Advanced button, then change the title. If two or more hours have passed, the EDIT button will not appear, and you need to ask a moderator to change the title

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Index & Match Formula

    Sorry zbor, based on the question and the sample file, the OP indeed needs a correction to his INDEX/MATCH formula, thus the title is accurate, though agreeably non-descriptive.

    =======
    Mahmuz, when you need to make multi-column matches like this, you make your life so much simpler by concatenating all the values to make a unique "key" in the data itself. I've added an indexing string into column F. In F3 and copied down:

    =B3&"-"&C3&"-"&D3

    Then take out the >7 and replace with 8. >10 becomes 11, etc. A MATCH() formula can treat this final number in the list as the 8+ or 10+ without you putting in the + or the >.

    With these two changes in place, sort the table by column B so the MATCH() formula can properly handle the fuzzy matches for 8+ or 10+, etc.

    Finally, the formula on the Data sheet becomes much simpler. In E3 entered as a normal formula then copied downward:

    =INDEX(Setup!$E:$E, MATCH(B3&"-"&C3&"-"&D3, Setup!$F:$F, 1))

    The 1 at the end is the part that allows the 8+ and 11+ etc to work.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Index & Match Formula

    OK than..

    In that case also IFERROR formula might work...

    IF it finds match then use it if there is no match (error) use last value of that instance...
    I've also provide solution as JB (with aditional column) but also users orignial formula will work...
    Attached Files Attached Files

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Index & Match Formula

    No, his original formula won't work, thus the point of the question. The array implementation is inherently flawed not the least of which because of the > strings in the data. IFERROR() is a tool available, but not sure it's needed since the properly sorted table plus corrected strings make a regular INDEX/MATCH() match to the last item in the range for values above the range.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Index & Match Formula

    JB - based on the OP sample file I don't believe yours works either.

    Presumably UAE / 20 / 0 should return errors as no valid record exists.
    Equally I suspect UK / 10 / 45 should return Delay rather than 3.

    Perhaps - based on the sample - the below will suffice:

    Please Login or Register  to view this content.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Index & Match Formula

    I keep forgetting Excel's staunch matching criteria for ascending numeric strings in text format. Those are problematic, aren't they.

    I like your construct, but I get "1" for KW 10 12 and I think that should be "delay".

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Index & Match Formula

    Quote Originally Posted by JBeaucaire View Post
    I get "1" for KW 10 12 and I think that should be "delay".
    I'm afraid I can't replicate - I get "delay" as expected.

  9. #9
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    106

    Re: Index & Match Formula

    Quote Originally Posted by JBeaucaire View Post
    Sorry zbor, based on the question and the sample file, the OP indeed needs a correction to his INDEX/MATCH formula, thus the title is accurate, though agreeably non-descriptive.

    =======
    Mahmuz, when you need to make multi-column matches like this, you make your life so much simpler by concatenating all the values to make a unique "key" in the data itself. I've added an indexing string into column F. In F3 and copied down:

    =B3&"-"&C3&"-"&D3

    Then take out the >7 and replace with 8. >10 becomes 11, etc. A MATCH() formula can treat this final number in the list as the 8+ or 10+ without you putting in the + or the >.

    With these two changes in place, sort the table by column B so the MATCH() formula can properly handle the fuzzy matches for 8+ or 10+, etc.

    Finally, the formula on the Data sheet becomes much simpler. In E3 entered as a normal formula then copied downward:

    =INDEX(Setup!$E:$E, MATCH(B3&"-"&C3&"-"&D3, Setup!$F:$F, 1))

    The 1 at the end is the part that allows the 8+ and 11+ etc to work.
    Thaks for your support and input.

  10. #10
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    106

    Re: Index & Match Formula

    Quote Originally Posted by zbor View Post
    OK than..

    In that case also IFERROR formula might work...

    IF it finds match then use it if there is no match (error) use last value of that instance...
    I've also provide solution as JB (with aditional column) but also users orignial formula will work...
    Thaks for your help & input.

  11. #11
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    106

    Re: Index & Match Formula

    Quote Originally Posted by zbor View Post
    Hi mahmuz, please adopt your title according to the ruels:

    1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change the title of the thread, click EDIT on the original post, then click the Go Advanced button, then change the title. If two or more hours have passed, the EDIT button will not appear, and you need to ask a moderator to change the title

    Thanks for your advice & input.

  12. #12
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    106

    Re: Index & Match Formula

    I would like to thanks everyone participate in this thread, and sorry if I missed any article of rules. Once again thanks.

+ 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