Formula Errors

Excel IF Formula: Return Zero for Values Between 1 and 1000

Adam DavisAdam Davis Oct 28, 2026 868 views

Question details

The user needs an Excel formula for cell M6 that outputs a zero if the value in cell O6 falls between 1 and 1,000. If the value falls outside this range, cell M6 should perform a standard calculation based on cell K6.

How to Return Zero for Values Between 1 and 1000 Using an IF Formula in Excel
Product
Excel
Device & OS
not provided
Scenario
Applying conditional logic in a spreadsheet where specific numerical ranges trigger a fixed output of 0, while all other numbers or blanks trigger an active formula calculation.
Observed behavior
The user requires the correct syntax to combine the IF function with range-checking logic, ensuring the formula properly distinguishes the 1-1000 range from other inputs.
Before you start

Ensure the cells containing your target values (such as cell O6) are formatted as Numbers, as text strings may cause logical formula evaluations to fail.

Solution 1Recommended

Use the IF and AND Functions to Evaluate the Number Range

Combine the IF function with the AND function to verify if a cell's value is simultaneously greater than or equal to 1, and less than or equal to 1000.

The AND function allows you to test multiple conditions at once. By nesting it inside the IF function, you can set the exact boundaries for your range before deciding what value the cell should return.

1
Select the Destination Cell

Click on cell M6 (or whichever cell you want the final result to appear in).

2
Input the Combined Formula

Type the following formula exactly: =IF(AND(O6>=1,O6<=1000),0,K6*13.5%).

3
Apply and Drag the Formula

Press Enter to execute the calculation. Hover over the bottom-right corner of cell M6 until the cursor turns into a plus sign, then click and drag down to apply this logic to the rest of your column.

Use the IF and AND Functions to Evaluate the Number Range
Formula Breakdown: The AND(O6>=1,O6<=1000) argument strictly checks the numerical range. If true, the formula outputs 0. If false (meaning the cell is blank, 0, or greater than 1000), it calculates your alternative equation: K6 multiplied by 13.5%.
Powerful Spreadsheet Tool

Easily Manage Conditional Formulas with WPS Spreadsheet

WPS Office offers a feature-rich Spreadsheet application that perfectly supports advanced mathematical logic, including IF, AND, and complex nested formulas. Its intuitive interface helps you build and troubleshoot data calculations efficiently.

  1. 1. Open Your Data: Launch WPS Spreadsheet and open your existing workbook.
  2. 2. Start Your Formula: Click the destination cell and type =IF( to trigger the auto-complete formula prompt.
  3. 3. Define the Condition: Insert the AND function to set your boundaries, then specify your true and false outputs.
  4. 4. Apply the Changes: Press Enter to calculate the cell and use the fill handle to drag the formula across your dataset.
Fully compatible with Microsoft Excel file formats (.xlsx) and formulasColor-coded formula syntax highlighting for easy range troubleshootingCompletely free to download and use for your daily spreadsheet tasksLightweight software that runs smoothly on older devices
microsoft office alternative - wps office

Frequently Asked Questions

How do I return a blank cell instead of zero if the condition is met?

To return an empty cell instead of the number 0, replace the 0 in the formula with double quotation marks. The modified formula would be: =IF(AND(O6>=1, O6<=1000), "", K6*13.5%).

Why does my IF formula return an error when checking the range?

This usually happens if the reference cell contains text formatted to look like numbers, or contains hidden spaces. Use the VALUE() function on your reference cell or check for trailing spaces to ensure Excel reads it as a true numerical value.

How do I modify the formula to exclude 1 and 1000 from the zero output?

If you only want values strictly between 1 and 1000 (meaning numbers 2 through 999) to output zero, remove the equal signs from the greater-than and less-than operators: =IF(AND(O6>1, O6<1000), 0, K6*13.5%).

Can I format the cell color instead of changing the value for this range?

Formulas written directly in cells can only alter the output value. To change the cell color when a value is between 1 and 1000, highlight the column, navigate to the Home tab, select Conditional Formatting > Highlight Cells Rules, and click 'Between' to apply a custom color rule.