Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Calculate Conditional Percentile ‘IF’ in table in Excel
  • Filter Data Based on Date in Excel
  • How to add Trendline to a chart in Excel
  • How to Use Solver Tool in Excel
  • How To Insert and Customize Sparklines in Excel

References

  • Extract all partial matches in Excel
  • How to reference named range different sheet in Excel
  • Convert text string to valid reference in Excel using Indirect function
  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel ROW Function

Data Validations

  • Excel Data validation date in specific year
  • Excel Data validation allow uppercase only
  • Excel Data validation exists in list
  • Excel Data validation whole percentage only
  • Excel Data validation specific characters only

IF with boolean logic in Excel

by

This tutorial shows how to calculate IF with boolean logic in Excel using the example below;

Formula

= IF(criteria1*criteria2*criteria3,result)

Explanation

In the example shown, the formula in F8 is:

{=SUM(IF((color="red")*(region="East")*(quantity>7),quantity))}

Note: this is an array formula, and must be entered with control + shift + enter.

How this formula works

Note: This example demonstrates how to replace a nested IF formula with a single IF in an array formula using boolean logic. This technique can be used to reduce complexity in complex formulas. However, the example is for illustration only. This particular problem could be easily solved with SUMIFS or SUMPRODUCT.

The formulas in F7 and F8 return the same result, but have different approaches. In cell F7, we have the following formula, using a nested IF approach:

{=SUM(IF(color="red",IF(region="east",IF(quantity>7,quantity))))}

This is how Excel evaluates the IFs inside SUM:

=IF({TRUE;FALSE;FALSE;TRUE;FALSE;FALSE;TRUE;FALSE;TRUE},
IF({TRUE;FALSE;TRUE;FALSE;TRUE;FALSE;TRUE;FALSE;TRUE},
IF({FALSE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE},quantity)))

In essence, each IF “filters” values into the next IF, and only quantities where all three logical tests return TRUE “survive” the operation. Other quantities become FALSE and are evaluated by SUM as zero. The final result inside SUM is an array of values like this:

=SUM({FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;8;FALSE;10})

FALSE values evaluate to zero, and the SUM function returns a final result of 18.

In F8 we have this formula, which uses a single IF and boolean logic:

=SUM(IF((color="red")*(region="East")*(quantity>7),quantity))

Each logical expression returns a an array of TRUE and FALSE values. When these arrays are multiplied together, the math operation coerces values to ones and zeros in a single array like this:

IF({0;0;0;0;0;0;1;0;1},quantity)

The array of 1s and 0s filters out irrelevant data, and the same result delivered to SUM:

=SUM({FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;8;FALSE;10})

As before, SUM returns a final result of 18.

Post navigation

Previous Post:

COSH function: Description, Usage, Syntax, Examples and Explanation

Next Post:

Excel Data validation require unique number

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

Logical Functions

  • Excel If, Nested If, And/Or Criteria Examples
  • TRUE function: Description, Usage, Syntax, Examples and Explanation
  • IFS function: Description, Usage, Syntax, Examples and Explanation
  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • IFERROR function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Dynamic date list in Excel
  • Get days, hours, and minutes between dates in Excel
  • Roll back weekday to Friday base on a particular date in Excel
  • Calculate time difference in hours as decimal value in Excel
  • Count dates in current month in Excel

Grouping

  • Group numbers with VLOOKUP in Excel
  • How to randomly assign data to groups in Excel
  • Categorize text with keywords in Excel
  • If cell contains one of many things in Excel
  • Calculate conditional mode with criteria in Excel

General

  • Hide and Unhide Columns or Rows in Excel
  • How to fill cell ranges with random number from fixed set of options in Excel
  • Select, Insert, Rename, Move, Delete Worksheets in Excel
  • Mark Workbook as Final in Excel
  • Find Most Frequently Occurring Word in Excel Worksheet
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning