How to Find the Latest Entry for a Customer in Excel
Find a customer’s most recent visit date with MAXIFS, what they bought last time with XLOOKUP, and the days since their last visit.
You will learn to
- Return the latest date for one customer
- Return a value from the customer’s last row
- Calculate days since the last visit
How it works
MAXIFS returns the largest value that meets a condition, and because dates are numbers, the largest date is the most recent: =MAXIFS(A2:A11,B2:B11,G1) gives the last visit for the customer named in G1, wherever their rows are in the list.
To pull another detail from that last row — the service or product — use XLOOKUP with search_mode -1, which searches from the bottom up and returns the last match in a chronological log. Subtract the latest date from an as-of date to get the days since last visit, the basis for rebooking reminders and churn alerts.
=MAXIFS(A2:A11,B2:B11,G1)