How to Count the Frequency of Text Values in Excel
Question details
The user needs to calculate how often specific or all text values appear in an Excel column.

- 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.
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.
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.
Click on an empty cell where you want the final frequency count to appear.
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.
Press Enter to calculate. Excel will display the exact number of times your specified text appears in the selected range.

Create a PivotTable to Summarize All Text Values
A PivotTable is the best choice when you need to see the frequency of every unique text value in your dataset at the same time.
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. Open your dataset: Launch WPS Spreadsheet and open the document containing the text data you want to analyze.
- 2. Use the COUNTIF formula: Select a blank cell, type =COUNTIF(Range, Criteria), and press Enter to instantly count specific text occurrences.
- 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.

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.




