The fastest way to count the number of times "yes" appears in an Excel column is the COUNTIF function: if your answers are in A2:A100, type =COUNTIF(A2:A100,"yes") into an empty cell and press Enter. That returns the number of cells that contain exactly "yes". If you also want to count "Yes", "YES" and any other capitalisation, the default COUNTIF behaviour already handles it, because text matching in COUNTIF ignores case. Everything below covers the variations you are likely to hit in real sheets: mixed yes/no data, blanks between entries, trailing spaces, answers that read like "Yes - confirmed", and counting across more than one column.

What You'll Need

  • A spreadsheet open in Excel (desktop Excel, Excel for the web or Excel on mobile all work, though the steps here assume the desktop grid).
  • A column with your answers in it. Ideally one answer per cell, even if the wording is messy.
  • An empty cell to put the result in, ideally just above or beside the column so it is easy to see.
  • Optional but useful: a header row on your data, so ranges are easy to check and you do not accidentally count the word "Yes" in a heading.

Step-by-Step

  1. Find the range of your column. Click the first answer cell, then hold Shift and click the last answer cell. Excel highlights the range and shows its address in the Name Box at the top left, for example A2:A100. Write that address down or remember it, because you will type it into the formula. Do not include the header row.
  2. Click an empty cell outside the column. A cell two or three columns to the right, or directly below the data with a gap, keeps the result visible and out of the way. Pressing a cell inside the column risks overwriting an answer.
  3. Type the COUNTIF formula. Enter =COUNTIF(A2:A100,"yes"), replacing A2:A100 with your own range. Press Enter. The cell now shows how many cells in that range contain the word yes.
  4. Check the result against what you expect. If you have a short column you can count by eye to verify the formula, do it once. Sorting the column alphabetically also makes counting easy by eye and confirms the formula is looking at the right cells.
  5. Make it robust against capitalisation and extra spaces. COUNTIF ignores case, so "YES" and "Yes" are already counted. It does not ignore spaces, so a cell containing " yes" with a leading space will not match. Fix the source data by using Find and Replace (Ctrl+H, or Cmd+H on Mac): search for a space followed by yes in the search box is fiddly, so the cleaner route is to select the column, open Data > Text to Columns and clean it, or simply use the formula in the next step.
  6. Use SUMPRODUCT for a cleaner text match. The formula =SUMPRODUCT(--(TRIM(UPPER(A2:A100))="YES")) trims spaces and normalises case before comparing each cell, so sloppy entries still count. Press Enter and confirm in the formula bar; depending on your Excel version this may need to be entered as an array formula with Ctrl+Shift+Enter, but modern Excel handles it as a normal formula.
  7. Count partial matches, like "Yes - confirmed". Use a wildcard: =COUNTIF(A2:A100,"yes*"). The asterisk stands for any number of characters after "yes". Use a question mark instead if you want to match exactly one extra character. Be careful: "yes*" would also match the word "yesterday", so check your data for words that start with those letters.
  8. Count blanks and non-yes answers for context. To see how many cells in the range are empty, use =COUNTBLANK(A2:A100). To see the total number of filled answers, use =COUNTA(A2:A100). Comparing the three numbers (yes, blanks, total) quickly shows whether some responses are missing.
  9. Count yes across several columns. If you have multiple yes/no columns and want one total, either repeat the COUNTIF for each column and add the results, or use =COUNTIF(B2:D100,"yes") to cover a rectangular block. Excel counts every cell in the block, so make sure the block does not include unrelated text.
  10. Turn it into a live summary. Put a label such as "Yes answers" in the cell to the left and format the count cell as a number. As you edit the column, the result updates automatically. If you change data and the count does not move, check that calculation is set to Automatic under Formulas > Calculation Options.

Common Mistakes

Including the header row. If your header text is "Answer" this usually does no harm, but if a header contains the word yes, or a wildcard formula is used, the header can be counted. Start the range at the first data row.

Using COUNT instead of COUNTIF. COUNT only counts numbers, and yes/no answers are text, so it returns zero or counts the wrong thing entirely. COUNTA counts any non-empty cell, which is useful for totals but not for counting one specific word.

Forgetting quotes around the criteria. Text criteria in COUNTIF must be in double quotes: COUNTIF(A2:A100,"yes"). Without them Excel throws an error or interprets the word as a named range.

Leaving trailing spaces in the data. "Yes " and "Yes" look the same on screen but are different strings, and COUNTIF treats them as different values. The TRIM-based SUMPRODUCT formula avoids this. Trailing spaces usually come from copying data out of another system.

Assuming wildcards work everywhere. In some Excel setups, wildcard behaviour in functions can be affected by settings, and in Google Sheets the equivalent is REGEXMATCH rather than COUNTIF wildcards. Keep the formula simple where you can.

Counting a filtered view by mistake. COUNTIF counts hidden rows too. If you have filtered the column and expect the number to match what is on screen, use =SUBTOTAL(3,A2:A100) or the SUBTOTAL function with the appropriate code, and test with the filter applied.

Tips

  • Use a named range (Formulas > Define Name) for the column so the formula reads =COUNTIF(AnswerColumn,"yes") and survives when rows are inserted.
  • Standardise the answers with a dropdown list under Data > Data Validation. When every entry is exactly "Yes" or "No", all counting formulas become simple and reliable.
  • To count both yes and no, write =COUNTIF(A2:A100,"yes") and =COUNTIF(A2:A100,"no") side by side. If their sum does not equal COUNTA, some cells contain something else, which is a useful data check.
  • If you want a percentage, put the yes count in one cell and the total in another, then divide: =B1/B2 formatted as a percentage.
  • Conditional formatting (Home > Conditional Formatting) can highlight every yes in a colour, which makes a manual sanity check very fast.

Troubleshooting

The formula returns zero but you can see yes values. Check the range address first, then check for leading or trailing spaces and for non-breaking spaces copied from web pages. Try the TRIM and UPPER version of the formula, or test one cell with =LEN(A2) to see whether it contains hidden characters.

You get an error like #NAME? or a popup about the formula. Excel may be using semicolons instead of commas in your region. Replace commas in the formula with semicolons: =COUNTIF(A2:A100;"yes").

The count is higher than you expect. A wildcard may be matching longer words, or the range may cover cells with comments, notes or hidden text. Narrow the range and test a smaller block first.

The count doesn't update when you type. Open Formulas > Calculation Options and set it to Automatic. If the workbook is very large, it may simply be recalculating slowly.

The result is a date or a strange number. The cell has the wrong number format, or the formula cell was placed in a column that inherited a date format. Format the cell as General or Number under Home > Number Format.

Frequently Asked Questions

Does COUNTIF ignore capital letters?

Yes. COUNTIF treats "yes", "Yes" and "YES" as the same text, so you do not need to worry about capitalisation.

How do I count yes in a whole column without picking a range?

You can reference the entire column as =COUNTIF(A:A,"yes"). This is convenient, but it also counts any header or footnote in that column, so it is worth checking the visible result once.

How do I count yes in more than one column at once?

Use a rectangular range, such as =COUNTIF(A2:C100,"yes"), or add separate COUNTIF formulas for each column. The rectangular version counts every matching cell inside the block.

Can I count yes values that also contain other words?

Yes, with a wildcard: =COUNTIF(A2:A100,"yes*") matches any cell that starts with yes, including "Yes, definitely".

Why does my count include filtered-out rows?

COUNTIF works on the whole range regardless of filters. To count only visible rows, use SUBTOTAL or apply the filter and use the status bar total as a rough guide.

What is the difference between COUNTIF and COUNTIFS?

COUNTIF checks one condition. COUNTIFS checks several at once, for example yes answers in column A that also have a specific region in column B.