The Problem
Order history tables get harder to read as they grow. When the same customer appears more than once, the real question is not whether they exist in the sheet but when they were last active.
This challenge asks us to answer that in two ways. First, we find the latest date anywhere in the log. Then we find the most recent date for one specific customer, Tesla Motors. Those sound similar, but they use different thinking because one is a simple top date and the other depends on matching the right customer before returning the date.
This kind of check shows up often in sales logs, support tickets, and activity reports. Once you know how to pull the latest record overall and the latest record for one name, it becomes much easier to build quick status checks from a raw transaction list.
How We Solve It
Excel stores dates as numbers, so later dates are larger values. That is why MAX works for the global latest date. For Tesla's most recent order, we need a lookup that searches from the bottom of the list instead of the top.
Method 1: MAX for the latest overall date
Method 1: Return the latest date in the whole order log.
MAX scans the date column and returns the largest date value. Because the largest serial number is the newest date, this is the simplest way to get the latest activity in the full table.
This solves the first part of the problem because we are not asking for a specific customer here. We only need the single most recent date anywhere in the list, so MAX can look at the full date range and return the top date directly into the summary cell.
=MAX(A2:A6)
Method 2: XLOOKUP from the bottom
Method 2: Search from the bottom so the last matching order is returned.
Normally a lookup returns the first match it sees, which would give the oldest Tesla record in this list. By setting the search mode to -1, XLOOKUP starts at the bottom and returns the newest matching order date instead.
This solves the problem because the formula looks for "Tesla Motors" in the customer column, then returns the matching value from the date column on the same row. Since the search runs upward from the bottom, the first Tesla match it finds is the latest Tesla order in the sheet, not the earliest one.
=XLOOKUP("Tesla Motors", B2:B6, A2:A6, "None", 0, -1)
Method 3: LARGE as an alternative
Method 3: LARGE can return the top date and also supports second or third latest dates later.
LARGE can also return the latest date when you ask for position 1. The nice thing about this pattern is that it scales naturally if you later want the second latest or third latest date from the same column.
This solves the same overall-date problem in a slightly different way. Instead of asking for the maximum value by name, it asks for the largest item in the date list by rank. That makes it useful when the sheet may later need the second most recent or third most recent order date too, not just the latest one.
=LARGE(A2:A6, 1)
Function Explanation
1. MAX
MAX returns the largest number in a range. Since Excel dates are stored as serial numbers, it becomes a quick way to return the newest date in a list.
Learn more this functionMAX
2. XLOOKUP
XLOOKUP can search forward or backward. The backward search mode matters here because Tesla appears more than once and we need the last match, not the first one.
3. LARGE
LARGE returns the nth largest value from a range. It is a useful extension of the same idea when a worksheet needs more than just the single most recent date.
Learn more this functionLARGE
If a result shows up as a number instead of a date, the formula is usually fine and the cell just needs date formatting. That happens because Excel is showing the raw serial value underneath the date.
Find the latest date in the full log, return the last order date for Tesla Motors, and complete the final summary cell so the worksheet also shows the total sales amount from the visible rows.