Mark the rows that pass every test — in stock AND above target AND not flagged. AND inside IF returns a clean label when all conditions hold.
The example
Only rows passing all checks are flagged.
| A | B | |
|---|---|---|
| 1 | Row | Flag |
| 2 | meets all | Ship |
| 3 | fails one | — |
The formula
All-true gate:
How it works
AND gates the label:
- List each condition inside
AND(…)— it’s TRUE only if every one is TRUE. - Wrap in
IFto return a readable result instead of TRUE/FALSE. - Use
ORinstead for “any condition,” or combine:AND(x, OR(y, z)). - For counting how many rows pass,
COUNTIFSwith the same conditions is the direct route.
AND collapses arrays. AND(range>100) returns a single TRUE/FALSE for the whole range, not per row. For per-row logic across columns it’s perfect; for array conditions, multiply (*) inside SUMPRODUCT instead.
Try it: interactive demo
Toggle three checks.
Variations
Any condition (OR)
At least one:
Count passing rows
Direct:
Mixed AND/OR
Group:
Pitfalls & errors
AND returns one value. It can’t do per-row logic over a whole column — use SUMPRODUCT with * for that.
Text comparisons. C2="In stock" is case-insensitive but space-sensitive — watch trailing spaces.
Empty result. Returning "" leaves a blank that still counts as non-empty to some functions.
Practice workbook
Frequently asked questions
How do I flag rows that meet all conditions in Excel?
How do I flag rows meeting any condition?
How do I count rows meeting all conditions?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class