Excel Formulas to Count Cells that contain either X or Y!!
Tags: excelformula, excelformulas
Published: 2020-10-31 11:49:12

---
title: Excel Formulas to Count Cells that contain either X or Y!!
published: true
date: 2020-10-30 12:06:03 UTC
tags: ExcelFormula,Excelformulas
canonical_url: https://geekexcel.com/excel-formulas-to-count-cells-that-contain-either-x-or-y/
---

Here we will see the **Formulas to count the cells that contain values either X or Y in Excel Office 365** with its basic syntax explanations and best example. Let’s get started!! Get an official version of ** MS Excel**  from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)

[![Formulas to count the cells that contain X or Y](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/10/Formulas-to-count-the-cells-that-contain-X-or-Y.png)](https://geekexcel.com/excel-formulas-to-count-cells-that-contain-either-x-or-y/formulas-to-count-the-cells-that-contain-x-or-y/#main)<figcaption id="caption-attachment-16541">Formulas to count the cells that contain X or Y</figcaption>
## General Formula:

- The below formula will help to count the number of cells that contain values either this or that in Excel.

**=[SUMPRODUCT](https://geekexcel.com/how-to-use-excel-sumproduct-function-in-office-365/)(–(([ISNUMBER](https://geekexcel.com/how-to-use-isnumber-function-in-microsoft-excel-365/)([FIND](https://geekexcel.com/how-to-use-find-function-in-microsoft-excel-365/)(“X”,range))+ISNUMBER(FIND(“Y”,range)))>0))**

## Explanations for Syntax:

- **SUMPRODUCT** – The Excel **[SUMPRODUCT Function](https://geekexcel.com/how-to-use-excel-sumproduct-function-in-office-365/)** will multiply the ranges or arrays together and returns the output as the sum of products.
- **ISNUMBER** – It will return TRUE when a cell contains a number otherwise it returns FALSE. Read More on the **[ISNUMBER Function](https://geekexcel.com/how-to-use-isnumber-function-in-microsoft-excel-365/)**.
- **FIND** – This function helps to return the position of one text string inside another. Read more on the [**FIND Function**](https://geekexcel.com/how-to-use-find-function-in-microsoft-excel-365/).
- **Range** -It represents an input range given in a worksheet.
- **X or Y** – It is the criteria to count the cells that should begin with particular values.
- **Plus operator (+)** – This is used to add the two values or arrays.
- **Minus operator (-)** – This symbol helps to subtract two numbers or arrays.
- **Comma (,)** – It is a separator which helps to separate a list of values.
- **Parenthesis ()** – The main purpose of this symbol is to group the elements.

## Example:

- In the below image, we give the input in **Column B**.
- After that, enter the given formula in the selected field.
- Finally, it will show the result as shown below.

![Example](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/10/Example-43.png)<figcaption id="caption-attachment-16540">Example</figcaption>

## Closure:

In this article, you can get some clarification on the **formulas for counting the cells that contain values either this or that in Excel Office 365** with its brief explanations. Hope that this article is useful to you. If you have any doubts/queries, feel free to share it with us. Thank you so much for Visiting Our Site!! Continue learning on **[Geek Excel](https://geekexcel.com/)!! **Read more on [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**