In a list, you might need to count the number of Yes and No entries. This article discusses how to count the number of “Yes” or “No” answers in Excel. Such a count could help find the number of entries selected or rejected.
How to count number of Yes or No entries in Excel
This calculation can be useful, for example, if you are deciding on the number of sportspersons selected (or rejected) for an event or the number of products approved selected or rejected for export.
We will use the COUNTIF function to sort the count. This isn’t limited to Yes or No, but any repeated value across a column.
Count number of Yes or No entries in Excel
The syntax for the COUNTIF function for finding the number of repetitive entries across a column is as follows:
=COUNTIF(<first cell>:<last cell>,"<repetitive entry>")
Where,
- <first cell> is the first cell in the column of entries from which you need to calculate the number of repetitive entries.
- <last cell> is the first cell in the column of entries from which you need to calculate the number of repetitive entries.
- <repetitive entry> is the exact phrase, letter, number, or symbol of the repetitive entry that you need to be counted. It could be Yes, No, 1, 0, Rejected, Selected, or anything.
Eg. If you need to count the number of Yes and No entries for a list of 10 people, such that the Yes and No entries are placed in Column C from C4 to C13, the formula for the count of Yes entries would become:
=COUNTIF(C4:C13,"Yes")
And for the formula for the count of No entries would become:
=COUNTIF(C4:C13,"No")
Enter these formulae in the cells where you need the desired result.
Count number of entries other than “Yes” or “No” in Excel
If you wish to check the count of the entries in a list across a column other than the 2 selected entries, the formula would become:
=COUNTA(<first cell>:<last cell>)-COUNTIF(<first cell>:<last cell>,"<first entry>")-COUNTIF(<first cell>:<last cell>,"<second entry>")-COUNTIF(<first cell>:<last cell>,"=""")
Where,
- <first cell> is the first cell in the column of entries from which you need to calculate the number of repetitive entries.
- <last cell> is the first cell in the column of entries from which you need to calculate the number of repetitive entries.
- <first entry> is the first repetitive word and <second entry> is the second repetitive word.
In the case mentioned above, assuming that the first cell in column C is C4, the last cell is C13, the first entry is Yes and the second entry is No, the formula would become:
=COUNTA(C4:C13)-COUNTIF(C4:C13,"Yes")-COUNTIF(C4:C13,"No")-COUNTIF(C4:C13,"=""")
I hope it helps!
Now read: How to remove Blank Cells from a Microsoft Excel spreadsheet.