To make Excel return 0 whenever a value is less than 0, wrap the value in MAX: =MAX(A1,0). MAX returns the larger of the two numbers, so any negative result becomes 0 while positive values pass through unchanged. If you are capping a calculation, put the whole formula inside MAX instead of the cell reference, for example =MAX(B1-C1,0). That is the safest, shortest approach and it works in every Excel version, including Excel for Microsoft 365, Excel 2021 and Excel 2019, on Windows, macOS, the web and the mobile apps.
What You'll Need
Nothing beyond Excel itself and a sheet with at least one column of numbers or a formula whose result can go negative. Menu and dialog labels can differ slightly by version, device and region, but the functions described here are identical everywhere.
- Any current Excel version (Microsoft 365, Excel 2021, 2019 or older) or Excel for the web
- A cell containing a number, a reference like A1, or a calculation such as B1-C1
- A spare column if you want to keep the original values intact
Step-by-Step
- Pick your target cell. Click the cell where the corrected result should appear. If you want to preserve the raw numbers, put the formula in a new column next to them rather than overwriting the source data. Overwriting is fine for one-off clean-up, but a separate column makes your work auditable.
- Start the formula with an equals sign. Type
=MAX(. Excel will show a tooltip listing the arguments, which is a quick way to confirm you are on the right function. - Enter the value or calculation first. Click the cell you want to check (say A2) or type the whole expression, such as
B2-C2. So far you have=MAX(A2,or=MAX(B2-C2,. - Add the floor of zero. Type
0)and press Enter. The finished formula is=MAX(A2,0). Any negative number becomes 0; zero stays 0; positive numbers are returned unchanged. - Copy it down the column. Drag the fill handle (the small square at the bottom-right of the selection) down, or double-click it to fill to the end of the adjacent data. Relative references adjust automatically, so row 3 becomes
=MAX(A3,0). - Check the results on a few deliberate edge cases. Confirm that a negative input shows 0, a positive input shows itself, and a blank cell behaves as you expect. A truly empty cell is treated as 0 by MAX, so the result is 0. A cell containing text returns
#VALUE!instead. - Replace the original figures if required. If you need the capped values in place rather than in a helper column, select the formula cells, press Ctrl+C (Command+C on Mac), then use Paste Special > Values over the original range. This replaces formulas with static numbers, so keep a backup copy of the sheet first. Delete the helper column afterwards if you no longer need it.
- Use IF only if you need something other than 0 or the number. The equivalent conditional formula is
=IF(A2<0,0,A2), and=IF(B2-C2<0,0,B2-C2)for a calculation. It works, but it is longer, repeats the expression, and recalculates slightly more work; MAX is the cleaner choice for a simple floor at zero.
Common Mistakes
- Putting MAX in the wrong place.
=MAX(A2),0is invalid and Excel shows a formula error. The closing bracket must come after the zero, not before it. - Ordering the arguments backwards.
=MIN(A2,0)does the opposite: it caps values at 0 from above and forces positives to 0. MAX is the one for a floor. - Typing text instead of the number zero.
=MAX(A2,"0")with quotes compares text with a number and produces incorrect results. Use the number0with no quotes. - Forgetting that MAX ignores empty cells. If you point MAX at a blank range, it returns 0 rather than an error, which can look like a real result. Check for gaps in your data before trusting the output.
- Overwriting source data with no backup. Paste Special > Values is irreversible. Undo may not help after saving. Keep the original column until the new figures are verified.
- Expecting MAX to filter out text. If a cell contains a word or a stray space, MAX returns
#VALUE!. Clean the source with TRIM or remove the text first.
Tips
- Use
=MAX(SUM(B2:D2),0)to floor a whole row of subtractions in one go. You can also floor a running total by wrapping it the same way. - If you need a floor and a ceiling, combine them:
=MIN(MAX(A2,0),100)keeps the result between 0 and 100. MAX is the inner function, MIN the outer. - Apply the same idea to
=MAX(0,A2); the argument order does not matter for the result. Choose whichever you find more readable and stick with it across the workbook. - Use conditional formatting with a formula rule such as
=A2<0to highlight remaining negatives in red, which makes it obvious which cells still need attention. - If you are pulling data from Power Query, you can add a custom column step that uses the same logic, so the cap is applied on refresh rather than by a hand-written formula.
Troubleshooting
The formula shows #VALUE!. One of the referenced cells is text, not a number, or contains a stray non-breaking space pasted from a web page. Check each input with =ISNUMBER(A2) and clean it with =VALUE(TRIM(A2)).
The formula shows as plain text. The cell is formatted as Text, so Excel is not treating your entry as a formula. Select the cell, set the format to General, then re-enter the formula and press Enter.
MAX returns 0 when you expected a number. The referenced cell is empty, or the value was entered as text. Delete and retype the input, and confirm there is no leading apostrophe forcing text.
The results are correct but not updating. Check that calculation is set to Automatic under the Formulas tab in the ribbon; if it is set to Manual, press F9 (Fn+F9 on some Mac keyboards) to recalculate.
Paste Special > Values replaced formulas with zeros unexpectedly. This usually means the source cells were text-format values that MAX read as 0. Undo (Ctrl+Z) immediately, convert the source to real numbers, and reapply.
You need the cap only for a display, not the data. Use a custom number format or conditional formatting rather than changing the underlying value, so downstream totals still reflect the true figures.
Frequently Asked Questions
Does MAX work the same in Excel for the web and the mobile apps?
Yes. MAX is a core function available in every Excel edition, including the web and mobile versions. Only the interface around it changes.
What is the difference between MAX(A1,0) and IF(A1<0,0,A1)?
They give the same result for numbers. MAX is shorter and easier to read; IF becomes useful when you also want a different output, a message or a blank cell instead of zero.
How do I clamp a value between 0 and 100?
Combine the two functions: =MIN(MAX(A1,0),100). The inner MAX lifts negatives to zero, and the outer MIN caps anything above 100.
Can I apply the rule to a whole column at once?
Yes. Enter the formula in the top cell, then drag the fill handle or double-click it to fill down. Alternatively, use a Table (Ctrl+T) so the formula extends automatically when you add rows.
Why does my formula return 0 for a cell that has a number in it?
The cell is almost certainly stored as text. Check with =ISNUMBER(); if it returns FALSE, convert the value with =VALUE() or set the column format to Number and retype the entry.
Will MAX remove the negative signs from my original data?
No. MAX only changes the cell where the formula sits. The source column is untouched unless you paste the results over it, which is permanent and should be done only after backing up the sheet.