FormulaCraft

How to look up the most recent date for an item in Excel and Google Sheets

Topic:Lookups (any direction)
Excel & Google Sheets
=MAXIFS($B$2:$B$5,$A$2:$A$5,"Apple")

Verified example

Computed by a real spreadsheet engine on the sample data below.

ItemDate
Apple2024-01-15
Banana2024-01-20
Apple2024-02-05
Banana2024-01-10

=MAXIFS($B$2:$B$5,$A$2:$A$5,"Apple")0

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Ensure dates are stored as real date values, not text strings, in column B.
  2. 2In Excel 2019+ or Google Sheets, use =MAXIFS(date_range,criteria_range,criteria): =MAXIFS($B$2:$B$100,$A$2:$A$100,E2).
  3. 3For older Excel versions use the array formula =MAX(IF($A$2:$A$100=E2,$B$2:$B$100)) confirmed with Ctrl+Shift+Enter.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

How do I return a value from another column on the row with the most recent date?

Use INDEX/MATCH: =INDEX(C2:C100,MATCH(MAXIFS(B2:B100,A2:A100,E2),B2:B100,0)) retrieves the value in column C from the row with the latest date for the item in E2.

What if multiple rows share the most recent date?

MATCH returns the FIRST row that ties. To return all values on the latest date, use FILTER: =FILTER(C2:C100,(A2:A100=E2)*(B2:B100=MAXIFS(B2:B100,A2:A100,E2))).

How do I look up the most recent date without specifying an item?

Use plain MAX on the date column: =MAX($B$2:$B$100) returns the latest date across all items.

Why does MAXIFS return 0 / 1/0/1900?

No rows matched the criteria. Check the criteria value for trailing spaces (use TRIM), case mismatches, or text-vs-number issues. Wrap with IFERROR or COUNTIF to show a friendly message.

Does this work for date-time values (date + time stamps)?

Yes — MAXIFS treats date-time as a single decimal number, so it returns the latest exact moment. Format the result cell as date-time to see both parts.

How do I do this in Google Sheets?

MAXIFS works identically. Sheets users can also use SORT+FILTER: =FILTER(B:B,A:A=E2) wrapped in SORT(..., 1, FALSE) then INDEX to pull the top row.

More on Lookups (any direction)

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: