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

Lookup and Reference Examples

  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • How to reference named range different sheet in Excel
  • How to use Excel ROW Function
  • How to get relative column numbers in a range in Excel
  • Merge tables with VLOOKUP in Excel

Data Analysis Examples

  • Excel Frequency Function Example
  • How to conditionally sum numeric data in an Excel table using SUMIFS
  • Conditional Formatting Rules in Excel
  • How to calculate correlation coefficient Correlation in Excel
  • Conditional Formatting Data bars Examples in Excel

Data Validation Examples

  • Excel Data validation require unique number
  • Data validation must not exist in list
  • Excel Data validation specific characters only
  • Excel Data validation number multiple 100
  • Excel Data validation whole percentage only

Example of Count with Or Criteria in Excel

by

How to count data based upon multiple criteria?

Counting with Or criteria in Excel can be tricky. This article shows several easy to follow examples.

1. We start simple. For example, we want to count the number of cells that contain Google or Facebook (one column).

2a. However, if we want to count the number of rows that contain Google or Stanford (two columns), we cannot simply use the COUNTIF function twice (see the picture below). Rows that contain Google and Stanford are counted twice, but they should only be counted once. 4 is the answer we are looking for.

Worked Example:   If cell equals in Excel

2b. What we need is an array formula. We use the IF function to check if Google or Stanford occurs.

Explanation: TRUE = 1, FALSE = 0. For row 1, the IF function evaluates to IF(TRUE+TRUE,1,0), IF(2,1,0), 1. So the first row will be counted. For row 2, the IF function evaluates to IF(FALSE+FALSE,1,0), IF(0,1,0), 0. So the second row will not be counted. For row 3, the IF function evaluates to IF(FALSE+TRUE,1,0), IF(1,1,0), 1. So the third row will be counted, etc.

Worked Example:   How to count total words in a cell in Excel

2c. All we need is a SUM function that counts these 1’s. To achieve this (don’t be overwhelmed), we add the SUM function and replace A1 with A1:A8 and B1 with B1:B8.

2d. Finish by pressing CTRL + SHIFT + ENTER.

Note: The formula bar indicates that this is an array formula by enclosing it in curly braces {}. Do not type these yourself. They will disappear when you edit the formula.

Worked Example:   Basic text sort formula in Excel

Explanation: The range (array constant) created by the IF function is stored in Excel’s memory, not in a range. The array constant looks as follows:

{1;0;1;0;1;0;1;0}

This array constant is used as an argument for the SUM function, giving a result of 4.

3. We can go one step further. For example, we want to count the number of rows that contain (Google and Stanford) or Columbia.

Post navigation

Previous Post:

How to Sum Every nth Row in Excel

Next Post:

Count Errors 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
  • How to Capitalize first letter in a sentence in Excel
  • Remove file extension from filename in Excel
  • Split numbers from units of measure in Excel
  • Complete List of Excel Text Functions References and Examples
  • BAHTTEXT function: Description, Usage, Syntax, Examples and Explanation
  • How to get Weekdays, Working days between Two Dates in Excel
  • How to get year from date in Excel
  • WORKDAY.INTL function: Description, Usage, Syntax, Examples and Explanation
  • Basic Overtime Calculation Formula in Excel
  • Assign points based on late time in Excel
  • Bond valuation example in Excel
  • RECEIVED function: Description, Usage, Syntax, Examples and Explanation
  • IRR function: Description, Usage, Syntax, Examples and Explanation
  • DB function: Description, Usage, Syntax, Examples and Explanation
  • XNPV function: Description, Usage, Syntax, Examples and Explanation
© 2022 xlsoffice . All Right Reserved. | Teal Smiles