← All how-to recipes

How to find the minimum value with a condition

✓ Verified in LibreOffice 25.8.7.3

Get the smallest value among only the rows that match a criterion — like the lowest East-region sale.

The formula

AppFormulaNotes
Excel=MINIFS(B2:B6,A2:A6,"East")Excel 2019+. Add more range/criteria pairs to AND conditions.
Google Sheets=MINIFS(B2:B6,A2:A6,"East")Identical.
LibreOffice Calc=MINIFS(B2:B6,A2:A6,"East")Identical.

How it works

MINIFS scans the criteria range and takes the minimum of the value range only where it matches — among East's 150, 80 and 200 the smallest is 80. MAXIFS is the mirror for the largest. If no row matches, MINIFS returns 0 rather than an error, which is worth guarding with a COUNTIF check when 0 could be mistaken for real data.

Verified, not just documented

We ran =MINIFS(B2:B6,A2:A6,"East") in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 80 — exactly the expected result. Every formula here is confirmed by actually executing it.