Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • Perform case-sensitive Lookup in Excel
  • How to use Excel MMULT Function
  • Last row number in range
  • Vlookup Examples in Excel
  • Extract data with helper column in Excel

Data Analysis Examples

  • How to create a Histogram in Excel
  • How To Insert and Customize Sparklines in Excel
  • How to create running total in an Excel Table
  • How to perform a t-Test in Excel
  • How to combine 2 or more chart types in a single chart in Excel

Data Validation Examples

  • Excel Data validation require unique number
  • Excel Data validation specific characters only
  • Excel Data validation exists in list
  • Excel Data validation allow uppercase only
  • Excel Data validation number multiple 100

If this AND that OR that in Excel

by

This tutorial shows how to calculate If this AND that OR that in Excel using the example below;

Formula

=IF(AND(A1="x",OR(B1="y",B1="z")),"x","")

Explanation

To test for various combinations of this AND that, or this OR that, you can use the IF function with the AND and OR functions. In the example shown, the formula in D6 is:

=IF(AND(B6="red",OR(C6="small",C6="medium")),"x","")

When an item is “red”, and either “small” or “medium”, the formula returns “x”. All other combinations return an empty string (“”).

Worked Example:   Check multiple cells are equal in Excel

How this formula works

In the example shown, we simply want to “mark” or “flag” rows where the color is “red” AND size is either “small” or “medium”. To return TRUE when items are red and small, we can use a logical statement constructed with the AND function:

AND(B6="red",C6="small")

To extend the statement to return TRUE when items are red and either small or medium, we can nest the OR function inside the AND function like this:

AND(B6="red",OR(C6="small",C6="medium"))

This snippet will return TRUE only if the value in B6 is “red” AND the value in C6 is either “small” or “medium”.  It is placed inside the IF function as the logical test. When the logical test returns TRUE, the IF function returns “x”. When the logical test returns FALSE, the IF function returns an empty string (“”).

Worked Example:   AND function: Description, Usage, Syntax, Examples and Explanation

Change the values returned by IF to suit your needs.

Worked Example:   Excel Data validation require unique number

Post navigation

Previous Post:

If this AND that in Excel

Next Post:

IF with wildcards in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • RIGHT, RIGHTB functions: Description, Usage, Syntax, Examples and Explanation
  • How to find and replace multiple values at same time in Excel
  • Join cells with comma in Excel
  • Change Case: Uppercase, Lowercase, Propercase in Excel
  • DBCS function: Description, Usage, Syntax, Examples and Explanation
  • Add business days to date in Excel
  • Get day name from date in Excel
  • How to calculate next day of week in Excel
  • Dynamic date list in Excel
  • Check If Two Dates are same month in Excel
  • Calculate cumulative loan principal payments in Excel
  • DOLLARFR function: Description, Usage, Syntax, Examples and Explanation
  • How to set check register balance in Excel
  • RATE function: Description, Usage, Syntax, Examples and Explanation
  • PPMT function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2022 xlsoffice . All Right Reserved. | Teal Smiles