Formula Errors

Fix an Excel IFS Formula for a Result Between 3 Million and 5 Million

Rana GarciaRana Garcia Nov 12, 2026 869 views

Question details

Correct an IFS formula so it returns the value of D22-D18 only when that result is between 3,000,000 and 5,000,000.

Fix an Excel IFS Formula for a Result Between 3 Million and 5 Million
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user needs to test the calculated difference between cells D22 and D18 against a numeric range.
Observed behavior
The original formula uses unnecessary one-item array constants and may use an incorrect cell reference, which can produce an unexpected result or #N/A.
Before you start

Confirm that D22 and D18 contain numeric values, not numbers stored as text. Decide whether exactly 3,000,000 and 5,000,000 should be included in the allowed range.

Solution 1Recommended

Return D22-D18 only when it is strictly between 3,000,000 and 5,000,000

Use this formula when the result must be greater than 3,000,000 and less than 5,000,000; the two boundary values are excluded.

The formula calculates D22-D18, checks both range conditions with AND, and returns the numeric calculation when both conditions are true. Do not wrap values such as 5000000 in array constants like {"5000000"}, because an array result is not needed.

1
Select the result cell

Click the cell where you want the range-checked result to appear.

2
Enter the corrected IFS formula

Type or paste =IFS(AND(D22-D18>3000000,D22-D18<5000000),D22-D18) and press Enter.

3
Check the referenced cells

Verify that both parts of the calculation use D18. Replace any unintended reference to D17 if the calculation is meant to be D22-D18.

Return D22-D18 only when it is strictly between 3,000,000 and 5,000,000
No-match result: If D22-D18 is not within the range, IFS returns #N/A because no condition is true. Add a final default condition if you want to display another result instead.
Spreadsheet formula help

Use WPS Spreadsheets to test a calculated value within a range

WPS Spreadsheets lets you enter the same IFS, AND, and comparison formulas to calculate D22-D18 and return the value only when it meets your selected range conditions.

  1. 1. Open the worksheet in WPS Spreadsheets: Launch WPS Office, choose Spreadsheets, and open the Excel workbook containing cells D18 and D22.
  2. 2. Select the output cell: Click the cell that should display the result of the range check.
  3. 3. Enter the formula: For an inclusive range, enter =IFS(AND(D22-D18>=3000000,D22-D18<=5000000),D22-D18,TRUE,"").
  4. 4. Confirm the result: Press Enter, then change or review the values in D22 and D18 to verify that the formula returns the expected result.
Create range checks with IFS, AND, >=, and <= formulas.Avoid unnecessary array constants when a single numeric result is needed.Open and edit Microsoft Excel .xlsx and .xls workbooks with formula compatibility.Use a familiar spreadsheet interface for reviewing cell references and formula results.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my IFS formula return #N/A when the result is outside the range?

IFS returns #N/A when none of its conditions evaluate to TRUE. Add a final condition such as TRUE,"" or TRUE,0 to provide a fallback result.

Should I use > or >= in an IFS range formula?

Use > and < to exclude 3,000,000 and 5,000,000. Use >= and <= to include values exactly equal to those limits.

Do I need braces around numbers in an Excel formula?

No. Braces such as {"5000000"} create an array constant and are unnecessary for a single numeric comparison. Use 5000000 directly.

Why should the formula return D22-D18 instead of a quoted value?

Returning D22-D18 keeps the result numeric, allowing it to be summed, compared, or used in other formulas. A quoted value such as "5000000" is text.

How can I check whether the formula references the wrong cell?

Click the formula cell and inspect the formula bar. If the intended calculation is D22-D18, replace any accidental D17 reference with D18.