To subtotal count text in Excel, you cannot use the standard SUBTOTAL function with function_num 2 or 3 because those functions only count numbers or non-blank cells regardless of the content type. The most effective way to achieve a dynamic count of text that updates when you filter your data is to combine the SUBTOTAL function with the SUMPRODUCT and OFFSET functions, or use a helper column with a simple SUBTOTAL formula. This allows you to ignore rows hidden by a filter and count only the visible text entries in a specific range.

What You'll Need

  • Microsoft Excel (Desktop version recommended for full formula support).
  • A dataset containing a column of text values (e.g., names, categories, or status updates).
  • The data should ideally be formatted as an Excel Table (Ctrl + T) to ensure ranges expand automatically.
  • Basic familiarity with entering formulas into a cell.

Step-by-Step

Depending on your technical comfort level, there are two primary ways to do this. The first is the "Helper Column" method, which is the most stable and easiest to audit. The second is the "Advanced Formula" method, which keeps your sheet clean but is more complex to write.

Method 1: The Helper Column (Recommended)

  1. Prepare your data: Ensure your data is in a clean list. For example, if your text data is in column A (A2:A100), make sure there are no completely empty rows within the dataset.
  2. Create the helper column: In the column immediately to the right of your data (e.g., column B), create a header called "Visibility".
  3. Insert the visibility formula: In cell B2, enter the formula =SUBTOTAL(103, A2). The number 103 tells Excel to use COUNTA (count non-blanks) while ignoring rows that have been manually hidden or filtered out.
  4. Drag the formula down: Double-click the fill handle (the small square at the bottom-right of cell B2) to copy the formula down to the end of your dataset. Now, every visible row will show a "1" and every hidden row will effectively be ignored by the final calculation.
  5. Calculate the final subtotal: In the cell where you want the total count to appear (usually above your headers), enter: =SUM(B2:B100).
  6. Test the filter: Click the filter dropdown on your text column and deselect a few items. You will see the SUM in your total cell update instantly to reflect only the visible text entries.

Method 2: The Advanced Single-Cell Formula

  1. Identify your range: Determine the range of text you want to count. For this example, we will use A2:A100.
  2. Enter the complex formula: In your target cell, enter the following formula: =SUMPRODUCT(SUBTOTAL(103, OFFSET(A2, ROW(A2:A100)-MIN(ROW(A2:A100)), 0))).
  3. Break down the logic: To understand why this works, remember that SUBTOTAL normally returns a single value for a whole range. By using OFFSET and ROW, we force Excel to evaluate the SUBTOTAL function for every single row individually.
  4. Verify the array: The OFFSET function creates a series of individual cell references. SUBTOTAL(103, ...) then checks if each of those individual cells is visible.
  5. Sum the results: SUMPRODUCT then adds up all the 1s (visible) and 0s (hidden) generated by the SUBTOTAL operation, giving you a final count of visible text cells.

Common Mistakes

One of the most frequent errors is using =SUBTOTAL(3, A2:A100) and expecting it to behave like a conditional count. While this counts non-blank cells, it does not allow you to specify "only text" if your column contains a mix of numbers and text. It simply counts anything that isn't empty.

Another common mistake is applying the formula to the entire column (e.g., A:A). Because SUBTOTAL and SUMPRODUCT are calculation-heavy, referencing over a million rows can cause Excel to freeze or lag significantly. Always define a specific range (like A2:A1000) or use an Excel Table reference (like Table1[ColumnName]) to keep the workbook performant.

Users also often confuse the function numbers 3 and 103. Function 3 ignores rows hidden by a filter but includes rows that were hidden manually (right-click > Hide). Function 103 ignores both filtered-out rows and manually hidden rows. If you want the most accurate "what I see is what I count" result, always use 103.

Tips

To make your subtotal count more dynamic, convert your data range into an official Excel Table by pressing Ctrl + T. When you do this, you can use structured references in your formulas. Instead of A2:A100, your formula would look like . The benefit here is that as you add new rows of text to the bottom of the table, the subtotal formula updates automatically without you having to change the range.

If you need to count specific text (e.g., only count cells that say "Complete" while filtered), the helper column method is superior. In your helper column, you can use an IF statement: =IF(AND(A2="Complete", SUBTOTAL(103, A2)=1), 1, 0). This checks both the content of the cell and its visibility before assigning a 1.

For those using the latest versions of Excel (Microsoft 365), you can explore the FILTER function combined with COUNTA. While not a traditional "subtotal," =COUNTA(FILTER(A2:A100, (A2:A100="YourText"))) can be powerful, though it does not automatically react to the UI filter buttons in the same way SUBTOTAL does.

Troubleshooting

The formula returns 0 even though I see text: Check if your cells are actually empty or contain invisible characters. A cell with a single space is not "empty" and will be counted by COUNTA/SUBTOTAL 103. Conversely, if your formula is referencing the wrong column, it will return 0. Ensure the range in your OFFSET function matches the range of your data exactly.

The count doesn't change when I filter: This usually happens if you used a standard COUNTIF or COUNTA formula instead of SUBTOTAL. Standard formulas ignore the "visibility" state of a row. Ensure you are using function 103 within the SUBTOTAL wrapper. If you are using the helper column method, ensure the SUM formula is pointing to the helper column, not the original data column.

Excel is lagging or showing "Calculating" for a long time: This is a sign that your SUMPRODUCT/OFFSET array is too large. Avoid referencing entire columns (A:A). Limit your range to the actual data area. If you have tens of thousands of rows, the helper column method is significantly faster for Excel to process than the advanced single-cell formula.

I get a #VALUE! error: This often occurs if the ranges in your SUMPRODUCT formula are not the same size. For example, if your OFFSET range is A2:A100 but your ROW range is A2:A50, Excel cannot align the arrays and will throw an error. Double-check that every range reference in the formula starts and ends at the same row number.

Frequently Asked Questions

Can I use SUBTOTAL to count only unique text values?

No, the SUBTOTAL function cannot identify uniqueness. To count unique visible text, you would need a much more complex array formula involving 1/COUNTIF or use a Pivot Table with the "Add this data to the Data Model" option checked to enable the "Distinct Count" feature.

Does this work for dates?

Yes. Excel treats dates as numbers, but the SUBTOTAL(103, ...) function counts any non-blank cell regardless of whether it contains a date, a number, or text. It will work perfectly for date columns.

Will this work in Google Sheets?

Yes, the SUBTOTAL and SUMPRODUCT functions work similarly in Google Sheets. The syntax =SUMPRODUCT(SUBTOTAL(103, OFFSET(...))) is generally compatible, though Google Sheets users often find the =QUERY function a more powerful alternative for filtered counts.

What is the difference between COUNTA and COUNT in this context?

COUNT only counts cells containing numbers. COUNTA (which is what function 3 and 103 use) counts any cell that is not empty, including text, errors, and numbers. Since you are counting text, you must use the COUNTA-based function numbers.

Can I count text that matches a specific word while filtered?

The easiest way is the helper column method. Use =IF(AND(A2="SpecificWord", SUBTOTAL(103, A2)=1), 1, 0) and then sum that column. A single-cell formula for this is possible but becomes extremely volatile and difficult to maintain.