Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
=MAXIFS($B$2:$B$5,$A$2:$A$5,"Apple")Computed by a real spreadsheet engine on the sample data below.
| Item | Date |
| Apple | 2024-01-15 |
| Banana | 2024-01-20 |
| Apple | 2024-02-05 |
| Banana | 2024-01-10 |
=MAXIFS($B$2:$B$5,$A$2:$A$5,"Apple")→0
Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
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.
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.
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))).
Use plain MAX on the date column: =MAX($B$2:$B$100) returns the latest date across all items.
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.
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.
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.
Look up a value in the top row of a table and return a value from a row below it — the horizontal cousin of VLOOKUP.
How-toUse LOOKUP with a search trick or XLOOKUP with search mode -1 to find the last occurrence of a value in a list.
How-toUse VLOOKUP or MATCH with wildcard characters (* and ?) to perform partial-match lookups on text values.
How-toUse INDEX with MATCH and the EXACT function to perform a lookup that distinguishes between uppercase and lowercase text.
How-toUse SUMIF or SUMIFS to sum all values that match a lookup criterion, returning the total of all matching rows rather than a single result.
How-toUse INDEX and MATCH with ABS and MIN to find the value in a list that is numerically closest to a target number.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: