Function Problems

How to Count the Frequency of Text Values in Excel

Chanuka GeekiyanageChanuka Geekiyanage Oct 26, 2026 869 views

Question details

The user needs to calculate how often specific or all text values appear in an Excel column.

How to Count the Frequency of Text Values in Excel
Product
Excel
Device & OS
not provided
Scenario
Analyzing categorical data to find out how many times specific text entries occur within a dataset.
Observed behavior
The user wants to achieve a summarized count of text values either individually using formulas or across an entire dataset simultaneously.
Before you start

Ensure your text data does not have hidden trailing or leading spaces, as Excel treats 'Apple' and 'Apple ' as different values. Consider using the TRIM function to clean your data first if necessary.

Solution 1Recommended

Use the COUNTIF Function for Specific Text Values

The COUNTIF function is the most direct way to count how many times a specific text string appears in a given range.

This method is ideal when you only need to look up a few specific text items and want the results to update automatically if your source data changes.

1
Select the result cell

Click on an empty cell where you want the final frequency count to appear.

2
Enter the COUNTIF formula

Type the formula =COUNTIF(A:A, "Apple") into the formula bar. Replace 'A:A' with the actual column or range containing your data, and replace 'Apple' with the specific text you are looking for.

3
Execute the formula

Press Enter to calculate. Excel will display the exact number of times your specified text appears in the selected range.

Use the COUNTIF Function for Specific Text Values
Use Cell References: Instead of typing the text in quotation marks directly into the formula, you can reference a cell containing the text (e.g., =COUNTIF(A:A, C1)).
Data Analysis Made Easy

Count Text Frequency and Analyze Data in WPS Spreadsheet

WPS Spreadsheet provides robust data analysis tools, including intuitive COUNTIF functions and lightning-fast PivotTables, fully compatible with Microsoft Excel.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the document containing the text data you want to analyze.
  2. 2. Use the COUNTIF formula: Select a blank cell, type =COUNTIF(Range, Criteria), and press Enter to instantly count specific text occurrences.
  3. 3. Generate a PivotTable: Highlight your data, navigate to the 'Insert' tab, click 'PivotTable', and drag your text field into both the Rows and Values areas to summarize all items at once.
Count text values effortlessly with hundreds of built-in formulasCreate interactive PivotTables in seconds to summarize large datasets100% compatible with Microsoft Excel (.xlsx) files and formatsLightweight, ad-free interface that runs smoothly on any device
microsoft office alternative - wps office

Frequently Asked Questions

Does the COUNTIF function in Excel distinguish between uppercase and lowercase letters?

No, the COUNTIF function is not case-sensitive. It treats words like 'Apple' and 'apple' as identical values. If you need a strictly case-sensitive count, you would need to use an array formula combining the SUMPRODUCT and EXACT functions.

Why is my COUNTIF formula returning 0 even though the text exists in the column?

This usually happens due to hidden leading or trailing spaces in your data cells. Because Excel looks for an exact match, 'Apple ' with a trailing space will not match 'Apple'. You can use the TRIM function on your data column first to remove accidental spaces.

Can I count cells that contain a specific word as part of a longer sentence?

Yes, you can use wildcard characters with the COUNTIF function. For example, using the formula =COUNTIF(A:A, "*Apple*") will count any cell that contains the word 'Apple', regardless of the text that comes before or after it.