Function Problems

Return a Cell Value When Multiple Conditions Are Met in Excel

Olivia MillerOlivia Miller Dec 2, 2026 868 views

Question details

Return a cell value only when a text condition and two numeric conditions are all met.

Return a Cell Value When Multiple Conditions Are Met in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet should return a value when a text cell contains yes, one number is below 3, and another number is above 0.
Observed behavior
The formula should return the specified value when all three tests are true and an alternative result otherwise.
Before you start

Identify the cell containing the value to return and the cells containing the text and two numbers to test. The example below uses A3 for the return value, B3 for the text, C3 for the value below 3, and D3 for the value above 0.

Solution 1Recommended

Combine IF and AND to test all three conditions

Use this formula when the return value should appear only if every condition is true.

1
Select an output cell

In Excel, click an empty cell where you want the result to appear.

2
Enter the formula

Type =IF(AND(B3="yes",C3<3,D3>0),A3,"Conditions not met") and press Enter.

3
Adjust the references

In the formula bar, replace A3, B3, C3, and D3 with the corresponding cells in your worksheet. Change "Conditions not met" to another message or use "" for a blank result.

4
Apply it to other rows

If needed, drag the output cell's fill handle down to copy the formula to additional rows.

Combine IF and AND to test all three conditions
All conditions must be true: The formula returns the value in A3 only when B3 equals yes, C3 is less than 3, and D3 is greater than 0. Otherwise, it returns the specified alternative.
Work with formulas in WPS

Test Multiple Conditions in WPS Spreadsheet

Use the same IF and AND formula in WPS Spreadsheet to return a value only when your text and numeric conditions are met.

  1. 1. Open your workbook: Open WPS Spreadsheet and select Open to load your worksheet.
  2. 2. Choose an output cell: Click an empty cell where you want the conditional result.
  3. 3. Enter the formula: Type =IF(AND(B3="yes",C3<3,D3>0),A3,"Conditions not met") and press Enter.
  4. 4. Update the cell references: Use the formula bar to replace the example references with the cells in your workbook, then drag the fill handle down if you need results for more rows.
Combine text and numeric tests in one formula.Open and edit Microsoft Excel XLSX and XLS files.Copy the formula down a column for additional rows.
microsoft office alternative - wps office

Frequently Asked Questions

How can I leave the result blank when the conditions are not met?

Replace the final message with an empty string: =IF(AND(B3="yes",C3<3,D3>0),A3,"").

Does the text condition distinguish between yes and YES?

No. Excel's standard text comparison is not case-sensitive, so B3="yes" also matches YES.

Will the formula return a value if C3 equals 3 or D3 equals 0?

No. The operators <3 and >0 exclude those boundary values. Use <=3 or >=0 if the corresponding boundary should be included.

How do I apply the formula to every row?

Select the cell containing the formula and drag its fill handle down. Excel adjusts the relative row references for each copied formula.