+ Reply to Thread
Results 1 to 8 of 8

Index - Match - LOOKUP. How to get the status of every customer at the closest date

  1. #1
    Registered User
    Join Date
    04-02-2019
    Location
    ireland
    MS-Off Ver
    2013
    Posts
    4

    Index - Match - LOOKUP. How to get the status of every customer at the closest date

    Hi you all! I 've been killing myself trying to figure out how to get this done. I presume that the best way to do it is with INDEX -Match but I am not very good dealing with this formula.

    The issue is as following.

    For each customer ID I need to get his latest status before the date given. So my spreadsheet is as follow..

    Customer ID Reporting date Status
    66666666 01/06/2018 (Information to retrieve)

    In the other spreadsheet I have a massive data with different customers with as many rows as dates were reported. An example

    Customer ID Frequency Balance Date Balance Amount € Status
    66666666 W 15-Jun-18 10 9.99999999999999A
    66666666 W 16-Feb-18 14 9.99999999999999E

    I would really appreciate if anyone can give me a hand with this. I ve tried many different ways unsuccessfully and I am doing manually (nightmare)

    An example is attached. I hope to have explained myself correctly.

    Thanks a mil
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Index - Match - LOOKUP. How to get the status of every customer at the closest date

    Hi


    =IFERROR(LOOKUP(2,1/((Sheet2!K$2:K$6<=B6)*(Sheet2!A$2:A$6=A6)),Sheet2!M$2:M$6),""")

    not sure K2:K6 are the correct dates to compare to B6-7-8

    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    04-02-2019
    Location
    ireland
    MS-Off Ver
    2013
    Posts
    4

    Re: Index - Match - LOOKUP. How to get the status of every customer at the closest date

    Thank you very much canapone. Works perfectly

    Could you explain in words exactly what is happening and how with these formulas, for next time. I ve tried the formula valuation but still don't understand the beginning of the lookup formula (LOOKUP(2,1/((...).... I suppose that index-match wouldn't work with this issue, right?

    Regards,

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Index - Match - LOOKUP. How to get the status of every customer at the closest date

    Hi,

    same clear explation here

    https://www.excelforum.com/excel-for...d2-b2-b10.html

    Regards

  5. #5
    Registered User
    Join Date
    04-02-2019
    Location
    ireland
    MS-Off Ver
    2013
    Posts
    4

    Re: Index - Match - LOOKUP. How to get the status of every customer at the closest date

    Hi,

    The formula definitely works but it is not taking the closest date before the date given. How should I amend the formula?

    Sample is attached

    Thanks
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Index - Match - LOOKUP. How to get the status of every customer at the closest date

    Try this formula, entered as an array formula with ctrl+shift+enter:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-02-2019
    Location
    ireland
    MS-Off Ver
    2013
    Posts
    4

    Re: Index - Match - LOOKUP. How to get the status of every customer at the closest date

    it works lovely, thank you very much Melvosh. I've doing some training with index-match since lat weekend, So I am beginner with that formula. i understand the logic, but it seems tough to me to get the dynamic. Could you explain a bit this part of the formula..

    ((Sheet2!$K$2:$K$22766=MAX(IF(Sheet2!$A$2:$A$22766=$A2,IF(Sheet2!$K$2:$K$22766<=$B2,Sheet2!$K$2:$K$22766))))

    Thanks once again.

  8. #8
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Index - Match - LOOKUP. How to get the status of every customer at the closest date

    That part of the formula narrows down the balance date in your data to the max date that is less than or equal to the date you're looking for, while still matching all of the necessary criteria. I'd prefer to do it a little simpler, but MAX doesn't play very nicely with INDEX / MATCH array formulas, which is why the nested IF statements are needed.

    I hope that explanation is helpful (and coherent).

+ 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. Two-way lookup with INDEX and MATCH return closest match
    By Mschelle6 in forum Excel General
    Replies: 8
    Last Post: 12-06-2018, 02:03 PM
  2. Closest date (index match)
    By farniajr in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-22-2018, 02:34 AM
  3. [SOLVED] Index Match with closest prior date
    By Perk1961 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-29-2018, 11:56 PM
  4. Index match by closest prior date
    By chrisfav89 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-01-2016, 11:02 AM
  5. Replies: 2
    Last Post: 12-18-2014, 09:52 AM
  6. [SOLVED] Lookup temperature based on closest time using INDEX and MATCH
    By gshafiq in forum Excel General
    Replies: 7
    Last Post: 09-09-2014, 03:58 PM
  7. Index with closest date and ID match
    By Beccah in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-19-2014, 06:01 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