+ Reply to Thread
Results 1 to 10 of 10

Match array is wrong if two lookup arrays contain...

  1. #1
    Registered User
    Join Date
    04-11-2017
    Location
    Zagreb
    MS-Off Ver
    2013
    Posts
    4

    Match array is wrong if two lookup arrays contain...

    in two different rows two different values which when concatenetated produce the same string. Since Im sure this sentence is unclear here are some pictures:

    Capture.PNG

    Clearly Im trying to find a combination 54 1, but it returns the row where a combination 5 41 is located.

    Obviously excel match array functions in such a way that it concatentes the two searched values and then concatenates the rows from the lookup arrays and performes the search like that. This seems kind of amateurish. Anybody ran into this? Any solution? Kind of seems like a big deal if this is really so.

    EDIT:

    Attached an example excel file.
    Expected behaviour: The value returned by match array formula in cell E2 should be 3, not 1.
    Attached Files Attached Files
    Last edited by frizli; 04-11-2017 at 12:18 PM. Reason: Insuficient data

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,381

    Re: Match array is wrong if two lookup arrays contain...

    I'm sorry to have to say that nothing is at all clear!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Match array is wrong if two lookup arrays contain...

    Welcome to the forum, thank you for complying with Ali's request!

    Concatenation won't be able to tell the difference between 5&41 and 54&1, but you can use an array formula that separates the two values so you get the appropriate result. If value1 (54) is in E4 and value2 (1) is in E5, then the following array formula should work:

    =IFERROR(MATCH(1,($A$1:$A$3=$E$4)*($B$1:$B$3=$E$5),0),"No Match")

    Take a look at the attachment to see if it will do...
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-11-2017
    Location
    Zagreb
    MS-Off Ver
    2013
    Posts
    4

    Re: Match array is wrong if two lookup arrays contain...

    Yes, that works. I guess there are two methods for writing match array formulas and the one i used is not safe. Thank you!

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,381

    Re: Match array is wrong if two lookup arrays contain...

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Match array is wrong if two lookup arrays contain...

    You can also slightly ammend the original formula to introduce a 'Delimiter'

    =MATCH(54&"|"&1,A1:A3&"|"&B1:B3,0)

  7. #7
    Registered User
    Join Date
    04-11-2017
    Location
    Zagreb
    MS-Off Ver
    2013
    Posts
    4

    Re: Match array is wrong if two lookup arrays contain...

    That is also a good idea, it crossed my mind but i need to explain this to another person and i think it would just add to the confusion. The method where the search criteria is 1 seems nice and readable.

  8. #8
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Match array is wrong if two lookup arrays contain...

    Glad to help, good luck!

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Match array is wrong if two lookup arrays contain...

    What is the End Goal ?
    Are you going to use the result of that Match in an Index formula?
    To return the corresponding value from another column?

    If so, try
    =LOOKUP(2,1/(($A$1:$A$3=54)*($B$1:$B$3=1)),$C$1:$C$3)

    This does not require array entry.

  10. #10
    Registered User
    Join Date
    04-11-2017
    Location
    Zagreb
    MS-Off Ver
    2013
    Posts
    4

    Re: Match array is wrong if two lookup arrays contain...

    Yes, its just passed to index formula, I prefer index match combo. Thanks for the tip anyway!

+ 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 Partial Match in Lookup Array
    By AliGW in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-22-2016, 03:13 PM
  2. [SOLVED] Match-Index in stead of Index-Match lookup Array among Arrays
    By Numnum in forum Excel General
    Replies: 2
    Last Post: 10-15-2015, 02:08 PM
  3. [SOLVED] match function lookup array returns wrong value
    By elenama in forum Excel General
    Replies: 5
    Last Post: 08-17-2015, 06:13 AM
  4. [SOLVED] Double Index Match by Indirect Lookup Arrays
    By Erickson28 in forum Excel General
    Replies: 18
    Last Post: 07-30-2015, 12:46 PM
  5. [SOLVED] What wrong in array formula-vlookup & Match
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-14-2013, 01:59 PM
  6. Replies: 7
    Last Post: 06-19-2011, 12:51 PM
  7. Array and Match/Lookup
    By consigo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-13-2010, 08:25 AM

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