# Personal Career & Learning Guide for Data Analyst, Data Engineer and Data Scientist

Excel is a popular spreadsheet software that is widely used by data analysts for organizing, storing, and analyzing data. One of the common tasks for a data analyst is to count the number of rows that meet certain criteria. In this article, we will discuss how to count the rows with OR logic in Excel.

An OR condition in Excel is used to find the rows that meet at least one of the specified criteria. In other words, it returns all the rows that match either of the conditions. For instance, if you have a list of products and you want to find the number of products that are either red or blue, you can use an OR condition to count the number of rows that meet either of the two criteria.

To count the number of rows that meet an OR condition, you can use the SUMPRODUCT formula. This formula is a combination of two functions – SUM and PRODUCT. The SUM function adds up the values, while the PRODUCT function multiplies the values. The SUMPRODUCT formula allows you to perform both of these operations at the same time.

Here’s how you can use the SUMPRODUCT formula to count the rows with OR logic in Excel:

- Select a cell where you want to display the result of the formula.
- Enter the SUMPRODUCT formula, followed by an opening and closing bracket: =SUMPRODUCT().
- In between the brackets, enter a set of parentheses that define the conditions. For example: (A1=”red”)+(A1=”blue”).
- The formula will return the number of rows that meet either of the two conditions.
- To apply the formula to the entire column, select the cell with the formula and drag the fill handle down to the end of the column.

It’s important to note that the SUMPRODUCT formula only works with numbers, so if you have text or date values in your data, you need to convert them to numbers first. You can use the IF function to perform this conversion.

In conclusion, counting the number of rows that meet an OR condition in Excel is a common task for a data analyst. The SUMPRODUCT formula is a simple and efficient way to achieve this goal, and it allows you to perform the calculation quickly and accurately. With a little bit of practice, you’ll be able to master the formula and apply it to your own data analysis tasks.

# Excel Example for Data Analyst – Count rows with OR logic

Latest end-to-end Learn by Coding Projects (Jupyter Notebooks) in Python and R:

**All Notebooks in One Bundle: Data Science Recipes and Examples in Python & R****. **

**End-to-End Python Machine Learning Recipes & Examples.**

**End-to-End R Machine Learning Recipes & Examples.**

**Applied Statistics with R for Beginners and Business Professionals**

**Data Science and Machine Learning Projects in Python: Tabular Data Analytics**

**Data Science and Machine Learning Projects in R: Tabular Data Analytics**

**Python Machine Learning & Data Science Recipes: Learn by Coding**

**R Machine Learning & Data Science Recipes: Learn by Coding**

**Comparing Different Machine Learning Algorithms in Python for Classification (FREE)**

There are 2000+ End-to-End Python & R Notebooks are available to build **Professional Portfolio as a Data Scientist and/or Machine Learning Specialist**. All Notebooks are only $29.95. We would like to request you to have a look at the website for FREE the end-to-end notebooks, and then decide whether you would like to purchase or not.