Excel IF Formula: Return Zero for Values Between 1 and 1000
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.

- 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.
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.
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.
Click on cell M6 (or whichever cell you want the final result to appear in).
Type the following formula exactly: =IF(AND(O6>=1,O6<=1000),0,K6*13.5%).
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 Nested IF Functions as an Alternative
If you prefer not to use the AND function, you can nest two separate IF functions together to achieve the identical range-checking result.
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. Open Your Data: Launch WPS Spreadsheet and open your existing workbook.
- 2. Start Your Formula: Click the destination cell and type =IF( to trigger the auto-complete formula prompt.
- 3. Define the Condition: Insert the AND function to set your boundaries, then specify your true and false outputs.
- 4. Apply the Changes: Press Enter to calculate the cell and use the fill handle to drag the formula across your dataset.

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.




