Function Problems

How to Evaluate Three Criteria in Excel Using IF and AND Functions

Steve KSteve K Nov 2, 2026 871 views

Question details

The user needs to evaluate three specific conditions across different cells in a single row and return a customized text result based on whether all conditions are met.

How to Evaluate Three Criteria in Excel Using IF and AND Functions
Product
Excel
Device & OS
not provided
Scenario
Testing multiple criteria (such as Yes and No values) across three distinct cells in a single row, a scenario where the standard COUNTIF function falls short.
Observed behavior
COUNTIF evaluates one criterion range at a time and is inefficient for checking multiple specific cell conditions in a row. Instead, combining the IF and AND functions allows Excel to evaluate three cells simultaneously and return specific text.
Before you start

Ensure the text in the three cells you want to evaluate is spelled exactly as it appears in your formula (e.g., 'Yes' or 'No') and contains no hidden leading or trailing spaces.

Solution 1Recommended

Use a Nested IF and AND Formula

Combine the IF and AND functions to test whether three specific conditions are met simultaneously in a single row and return a custom text result.

The AND function checks if all given conditions are TRUE. By nesting the AND function inside an IF function, you can instruct Excel on what specific value to return if all three conditions are satisfied, and what value to display if any one of them fails.

1
Select the result cell

Click on the cell where you want the final custom text or error message to appear.

2
Enter the nested formula

Type the formula =IF(AND(A5="No", B5="No", C5="Yes"), "Custom", "Error") into the formula bar. Replace the cell references (A5, B5, C5) and conditions with your actual data.

3
Apply the formula

Press Enter. If cell A5 contains 'No', B5 contains 'No', and C5 contains 'Yes', the cell will display 'Custom'. If any condition is false, it will display 'Error'.

4
Copy to other rows

Click the small square at the bottom-right corner of the selected cell and drag it down to apply this logic to the remaining rows in your dataset.

Use a Nested IF and AND Formula
Version Compatibility: This formula works flawlessly in Microsoft 365. If you encounter issues in much older versions of Excel, double-check your syntax and ensure your cell values do not contain hidden formatting.
Advanced Spreadsheet Functions

Evaluate Multiple Conditions Seamlessly in WPS Spreadsheet

WPS Spreadsheet fully supports advanced logical formulas, including nested IF and AND functions. You can evaluate complex datasets with multiple criteria easily and for free.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing the dataset you want to evaluate.
  2. 2. Select the target cell: Click on the empty cell where you want to output the condition result.
  3. 3. Insert the logical formula: Type your formula, such as =IF(AND(A5="No",B5="No",C5="Yes"),"Custom","Error"), exactly as you would in Microsoft Excel.
  4. 4. View results instantly: Press Enter to execute the formula and use the fill handle to drag it down for the rest of your column.
100% compatible with Microsoft Excel formulas and functionsLightweight application that opens large datasets instantlyBuilt-in formula helper for easy syntax guidance and error checkingCompletely free alternative for all your spreadsheet and data analysis needs
QA img-9

Frequently Asked Questions

Why isn't COUNTIFS working for checking three conditions in a single row?

COUNTIFS is designed to count the total number of rows that meet multiple criteria across specific ranges. It does not return a custom text string for a single row based on multiple specific cell values. For returning text based on single-row evaluations, IF and AND is the correct approach.

Can I check more than three criteria using the AND function?

Yes, the AND function in Excel can evaluate up to 255 individual conditions at once. Just add the additional logical tests inside the parentheses separated by commas, such as AND(A1="Yes", B1="No", C1="Yes", D1="No").

What if I want the formula to leave the cell blank instead of showing 'Error'?

You can change the last argument in your IF function to double quotation marks with nothing in between. The formula will look like this: =IF(AND(A5="No", B5="No", C5="Yes"), "Custom", "").

Can I use the OR function instead of AND if only one condition needs to be true?

Absolutely. If you want the formula to return 'Custom' when any one of the three criteria is met, simply replace 'AND' with 'OR'. The syntax would be =IF(OR(A5="No", B5="No", C5="Yes"), "Custom", "Error").