Excel IF Statement Two Conditions

You want to check two conditions with Excel IF function? You’ve come to the right place.
IF is one of Excel’s most popular and versatile functions. But things get exciting when you start combining it with multiple conditions — especially using AND, OR, nested IFs, and even blending it with SUMIFS.

In this article, let me show you how to write IF formulas with a real-life example using a sales dataset, depicted below. Click here to download the data file.

Sample data - Excel IF Function with two conditions

Example 1: Excel IF Statement Two Conditions Using AND

Excel IF Function - Two Conditions - Example scenario

Scenario: You want to check if a sale happened in the North region and if the revenue is more than 2000.

=IF(AND(G4>2000, C4="North"), "Yes", "No")

What this does: If both conditions are true, it says “Yes”. If even one fails, you get “No”.

This is perfect for filtering VIP-level sales in specific territories.


Example 2: IF with Date Condition

IF and Date conditions in Excel

Scenario: You want to see if the salesperson is Bob and the sale happened before April 15, 2025.

<span role="button" tabindex="0" data-code="=IF(AND(D4="Bob", B4

=IF(AND(D4="Bob", B4<DATE(2025,4,15)), "Yes", "No")

? DATE(2025,4,15) ensures your comparison stays clean even if the actual cell has time info baked in.


Example 3: Bonus Calculation Using IF + Arithmetic

Using IF with two conditions in Excel to calculate bonus

Scenario: You want to calculate bonus:

  • If revenue > 3000 and units sold > 35 ? 5% bonus
  • Otherwise ? 3% bonus

=IF(AND(G4>3000, F4>35), 5%, 3%) * G4

This is a very common use-case: checking two values to decide payout level.


Example 4: Multiple OR Conditions Inside IF

Using AND + OR functions inside IF function - Complex example

Scenario: Approve if either region is North or South, and salesperson is either Alice or Bob.

=IF(AND(OR(C4="North", C4="South"), OR(D4="Alice", D4="Bob")), "YES", "NO")

? Combine AND and OR when you need multiple “paths” to approval.


Example 5: Categorizing Using Nested IFs and Between

Nested IF function example

Scenario: Label accounts based on revenue:

  • Over 4500 ? “Major Account”
  • Between 3000 and 4500 ? “Key Account”
  • Else ? “Normal Account”
<span role="button" tabindex="0" data-code="=IF(G4>4500, "Major Account", IF(AND(G4>=3000, G4

=IF(G4>4500, "Major Account", IF(AND(G4>=3000, G4<=4500), "Key Account", "Normal Account"))

Nested IFs are a good fit when you have tiered logic like this.

[Learn how to write BETWEEN Condition in Excel]


Example 6: Day of Week Based Label

Nested IF with dates to figure out start, mid or end of week

Scenario: Label the day based on when the sale occurred:

  • Monday–Wednesday ? “Start of Week”
  • Thursday–Friday ? “Mid Week”
  • Weekend ? “Weekend”
<span role="button" tabindex="0" data-code="=IF(WEEKDAY(B4,2)<=3, "Start of Week", IF(WEEKDAY(B4,2)

=IF(WEEKDAY(B4,2)<=3, "Start of Week", IF(WEEKDAY(B4,2)<=5, "Mid Week", "Weekend"))

Note: WEEKDAY(date, 2) makes Monday = 1 and Sunday = 7.


Bonus: Beyond IF – Using Conditions in SUMIFS

IF is great when you’re checking one row at a time. But if you want to sum based on multiple filters, use SUMIFS.

SUMIFS Examples:

Total revenue from North region and Bob:

Combining IF and SUM to add up values that meet two criteria

=SUMIFS(G4:G33, C4:C33, "North", D4:D33, "Bob")

Units sold for Product A before or on April 20, 2025:

SUM IF with date conditions example
<span role="button" tabindex="0" data-code="=SUMIFS(F4:F33, E4:E33, "Product A", B4:B33, "

=SUMIFS(F4:F33, E4:E33, "Product A", B4:B33, "<=20-Apr-2025")

Revenue from South between April 10 and 25:

Dates between condition for SUMIFS - example
<span role="button" tabindex="0" data-code="=SUMIFS(G4:G33, C4:C33, "South", B4:B33, ">=10-Apr-2025", B4:B33, "

=SUMIFS(G4:G33, C4:C33, "South", B4:B33, ">=10-Apr-2025", B4:B33, "<=25-Apr-2025")

Highlight IF conditions are met

We can use Excel conditional formatting to highlight cells that meet one or more conditions. Here is a quick demo of how to highlight all revenue > 3000.

Highlight values that meet IF condition - excel example
  • Select the data you want to highlight
  • Go to Home > Conditional Formatting > and set up the rule based on the behavior you want. (For example, highlight cells -> Greater than is perfect for the above example)
  • Specify the input and format
  • Click ok to have the rule “dynamically applied” to your data
  • You can add more complex and multiple condition rules too. Refer to my conditional formatting basics page for a proper tutorial.

A Few More Handy Patterns

Here are a few more patterns you can experiment with:

Check for blank cells:

=IF(ISBLANK(D4), "Missing", "Present")

Combine IF with SEARCH (for partial matches):

=IF(ISNUMBER(SEARCH("Bob", D4)), "It's Bob", "Not Bob")

Complex multi-check with helper column idea:

Use a helper column like IsQualified that uses:

=IF(AND(G4>2500, F4>=25, C4="North"), "Qualified", "Nope")

Then you can filter or pivot based on IsQualified.


Final Thoughts

Combining IF with AND, OR, and nesting gives you powerful logic control — without writing code. Start with two conditions, then try combining patterns as shown here.

Want to go further? Try writing a formula that combines:

  • Multiple date checks
  • Region + product filters
  • Revenue thresholds

Let Excel do the thinking for you!

Additional Resources for you

Refer to below pages for more help on IF conditions with Excel.

  • 10 Advanced IF tricks you must know (or watch this video)
  • How to use SUMIFS to add up data that meets one or more conditions
  • Replacing long, nested IF functions with CHOOSE formula
  • BETWEEEN Formula in Excel
  • Conditional formatting – Highlight IF rules are met
  • IF challenges for you:
    • Can you vote in Sumeria?
    • Blood pressure categorization
    • Check if both dates are in the same month?

The post Excel IF Statement Two Conditions appeared first on Chandoo.org – Learn Excel, Power BI & Charting Online.

Original source: https://chandoo.org/wp/excel-if-statement-two-conditions/

Close Menu