+ Reply to Thread
Results 1 to 5 of 5

Do I use an INDEX/MATCH function or XLOOKUP for this example?

  1. #1
    Registered User
    Join Date
    05-25-2017
    Location
    Essex
    MS-Off Ver
    MS 2016
    Posts
    21

    Do I use an INDEX/MATCH function or XLOOKUP for this example?

    I have attached a simple template showing what I want to achieve, I have tried various functions to get the desired result.

    Essentially, the returned value should be £27,000 by using the criteria in cell A3, finding it in the range H6:K17 and then returning the value in the range H5:K5.

    Any help would be most appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Do I use an INDEX/MATCH function or XLOOKUP for this example?

    Your data is not in the greatest format, but the below should work
    =INDEX(H5:K5,SUMPRODUCT((H6:K17=A3)*(COLUMN(A6:D17))))

    or even
    =INDEX(H5:K5,SUMPRODUCT((H6:K17=A3)*(COLUMN(A1:D1))))

    it assumes your code only appears once in the range
    Last edited by davsth; 12-13-2021 at 05:31 AM.

  3. #3
    Registered User
    Join Date
    05-25-2017
    Location
    Essex
    MS-Off Ver
    MS 2016
    Posts
    21

    Re: Do I use an INDEX/MATCH function or XLOOKUP for this example?

    Thank you, the 2nd formula works on the example but it isn't working when I transfer to the main workbook that has more data. What does the COLUMN(A1:D1) actually do as the cells are blank? This might be why it isn't working in my main schedule.

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Do I use an INDEX/MATCH function or XLOOKUP for this example?

    All you need is which column in the range h5:k5 is the the match in

    the sumproduct formula will return a value of 1 to 4 column A is 1, B 2 etc


    then you are just indexing this value form the range h5:k5

    eg if the match was in column J, it should return a 3 as it is the value of column C, the third value in the range h5:k5 is j5

    H:k has to be as wide as A:D is this true?

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Do I use an INDEX/MATCH function or XLOOKUP for this example?

    Another option
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. Index/Match vs Xlookup
    By lastnn30 in forum Excel General
    Replies: 3
    Last Post: 11-28-2021, 01:53 PM
  2. XLOOKUP vs INDEX & MATCH?
    By andrewc in forum Excel General
    Replies: 9
    Last Post: 08-26-2021, 10:59 AM
  3. Second to last exact match using xlookup
    By Neeendre in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-24-2020, 10:07 AM
  4. VBA function to match multiple criteria faster than vlookup or index match
    By bkav1991 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-09-2020, 09:14 AM
  5. Replies: 14
    Last Post: 09-28-2019, 10:32 PM
  6. How to apply an Index.Match.Match function to all entries in a Listbox on a User Form
    By jason.drozd in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-25-2018, 01:54 AM
  7. Replies: 3
    Last Post: 06-17-2013, 12:37 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