DEV Community

Andrews
Andrews

Posted on • Originally published at geekexcel.com on

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

Formulas to count the cells that contain X or Y
Formulas to count the cells that contain X or Y

General Formula:

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

=SUMPRODUCT(–((ISNUMBER(FIND(“X”,range))+ISNUMBER(FIND(“Y”,range)))>0))

Explanations for Syntax:

  • SUMPRODUCT – The Excel SUMPRODUCT Function 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.
  • FIND – This function helps to return the position of one text string inside another. Read more on the FIND Function.
  • 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
Example

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!! *Read more on Excel Formulas *!!

Top comments (0)