# MAX formula generator

> Describe what you need and get a MAX formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested MAX examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/max · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

MAX returns the largest number from a list of values or ranges: the top sale, the latest date, the highest temperature.

Describe the task at [MAX formula generator](https://spreadsheetpractice.com/tools/formula-generator/max) and get a MAX formula for Excel and Google Sheets, tested on real data.

## Tested MAX examples

### Calculate each value as a percent of the maximum

`=B2/MAX($B$2:$B$6)`

Excel. Result on the sample sheet: 5 rows (C2:C6). [See it and try it](https://spreadsheetpractice.com/formulas/percent-of-maximum)

### Return 0 if a number is negative

`=MAX(0,B2-C2)`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/return-zero-if-negative)

### Calculate overtime hours over 8 hours a day

`=MAX(0,(C2-B2)*24-$G$1)`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/overtime-hours-over-8-hours-a-day)

### Count ties for the highest value

`=COUNTIF(B2:B11,MAX(B2:B11))`

Excel. Result on the sample sheet: 3. [See it and try it](https://spreadsheetpractice.com/formulas/count-ties-for-the-highest-value)

### Calculate days overdue

`=MAX(0,IF(C2="",$G$1,C2)-B2)`

Excel. Result on the sample sheet: 6 rows (D2:D7). [See it and try it](https://spreadsheetpractice.com/formulas/days-overdue)

### Return the entire row of the max value

`=FILTER(A2:D10,D2:D10=MAX(D2:D10))`

Excel. Result on the sample sheet: 1 row (A13:D13). [See it and try it](https://spreadsheetpractice.com/formulas/return-the-entire-row-of-the-max-value)

### Flag the highest value in a list

`=IF(B2=MAX($B$2:$B$7),"Top store","")`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/flag-the-highest-value)

### Calculate overtime pay over 40 hours

`=MIN(B2,$G$1)*C2+MAX(0,B2-$G$1)*C2*$G$2`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/overtime-pay-over-40-hours)

## Questions

### What does the MAX formula generator do?

You describe the task in plain English, and it writes the formula, using MAX where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does MAX do?

MAX returns the largest number from a list of values or ranges: the top sale, the latest date, the highest temperature.

### Can I learn to write MAX formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the MAX function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
