Check two things with AND and OR

Decisions with IF · About 5 minutes

Check two things with AND and OR

Some decisions need two checks. AND gives TRUE only when every check is TRUE. OR gives TRUE when at least one is.

=AND(B2>=75000,C2>=90) reads as "are sales 75,000 or more, and is attendance 90 or more?". Type big numbers without commas: 75000.

Put AND or OR inside IF as the question: =IF(AND(…),"Bonus","No bonus").

Part of Plus

Free during our founding launch: sign in to unlock this lesson's exercises, the timed practice sets and the rest of Plus. The free lessons stay free, with no account needed.

What AND and OR does

AND and OR check several conditions at once. A condition is a test each value passes or fails, like B2>=60. AND gives TRUE only when every condition passes. OR gives TRUE when at least one passes.

On their own they show TRUE or FALSE. Put one inside IF and you get an IF with two conditions, or more, that shows a clear word like "Pass" or "Retake".

How to write AND and OR

=AND(logical1, [logical2], ...)

logical1
The first condition, like B2>=60.
logical2, ...
More conditions, separated by commas. Excel accepts up to 255. Every one must pass for TRUE.

=OR(logical1, [logical2], ...)

logical1
The first condition.
logical2, ...
More conditions. Any one passing is enough for TRUE.

AND and OR worked example

A course needs 60 or more on the test and 50 or more on the lab. In D2 to D5, show Pass or Retake.

A course needs 60 or more on the test and 50 or more on the lab. In D2 to D5, show Pass or Retake.
ABCD
1NameTestLabResult
2Ana7258Pass
3Ben8140Retake
4Cy5565Retake
5Dee4930Retake
D2=IF(AND(B2>=60,C2>=50),"Pass","Retake")If the test in B2 is 60 or more and the lab in C2 is 50 or more, show Pass; otherwise show Retake. Only Ana passes both, so she gets Pass and the other three get Retake.

Common AND and OR mistakes

Everyone passes

The formula uses OR where it needs AND. With OR, Ben's 81 on the test is enough. Change OR to AND when every condition must pass.

A between check gives an odd answer

Write each side as its own condition: AND(B2>=10,B2<=20). A chain like 10<=B2<=20 is not read as "between".

The cell shows #NAME?

Put text in quotes inside the condition: C2="Yes", not C2=Yes. Without quotes the sheet looks for a name called Yes.

AND/OR or nested IF?

Use AND or OR inside one IF when several conditions lead to the same two results, like Pass or Retake. It is shorter and easier to check than one IF inside another.

When each condition leads to a different result, like three or more grade bands, you need a nested IF or IFS instead.

Questions people ask

How do I use IF with two conditions in Excel?

Put AND inside IF when both must be true: =IF(AND(B2>=50000,C2>=90),"Bonus","None").

What's the difference between AND and OR?

AND is TRUE only when every test is true. OR is TRUE when at least one test is true.

Can I use AND and OR in the same formula?

Yes. =AND(B2>100,OR(C2="North",C2="South")) needs an amount over 100 and either region.

How many conditions can AND check?

Up to 255 in Excel, though more than a few gets hard to read.

Why type 200000 and not 200,000 in a formula?

Inside a formula, a comma separates the parts, so 200,000 is read as two values. Type numbers without commas.

Theme