Counting Numeric and Text Cells

Written by Allen Wyatt (last updated March 21, 2026)
This tip applies to Excel 2007, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365


3

Wendy has a worksheet where Column A contains some cells that are numeric and others that are text. Some are even blank. Wendy would like to get a count of the cells that contain text and a count of those that contain numbers.

This can be accomplished in a couple of different ways. To get a count of cells that contain text, the most reliable method is to use either of these formulas:

=COUNTIF(A2:A123,"*")
=SUMPRODUCT(--ISTEXT(A2:A123))

If you want the number of cells that contain numbers, then you can also choose from two formulas:

=COUNT(A2:A123)
=SUMPRODUCT(--ISNUMBER(A2:A123))

Both return the same result, but you may want to use the second formula for consistency if you use SUMPRODUCT to count the number of cells containing text.

There is one thing to remember when counting numeric cells—Excel considers dates and times to be numeric values. That is because dates and times are stored, internally, as a numeric serial number.

If you want to take the counts a step further, you may want to count the number of cells that contain blanks or the number that contain error values. These counts can be derived with these two formulas:

=COUNTBLANK(A2:A123)
=SUMPRODUCT(--ISERROR(A2:A123))

Astute readers will notice that none of these formulas utilize the COUNTA function. That is because the function isn't particularly fussy about what it returns—as long as the cell contains something, it is included in the returned count. Thus, subtracting the result of the COUNT function (cells with numbers) from the COUNTA function (cells containing anything) won't render the number of text cells because a cell could also contain an error value or a logical value of some type.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13969) applies to Microsoft Excel 2007, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Comma-Delimited Differences for PC and Mac

When you choose to save worksheet data in CSV format, Excel gives you three choices for file formats. Those choices are ...

Discover More

Precise Ruler Adjustments

When adjusting the position of things on the Ruler (like tab stops), you can use the Alt key to get very precise in your ...

Discover More

Shortcut to Merge Cells

Need to merge a bunch of cells together on a regular basis? You'll love the two macros in this tip which can make short ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!

More ExcelTips (ribbon)

Calculating Unique IDs Based on Names and Initials

Sometimes it can be tricky to figure out how to get exactly what you want from a dataset. In this tip, you discover how ...

Discover More

Summing Only the Largest Portion of a Range

Given a range of cells, you may at some time want to calculate the sum of only the largest values in that range. Here is ...

Discover More

Identifying Missing Numbers in a Consecutive Series

If you have a series of consecutive numbers in a column, you may want to know if it really is consecutive. (In other ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 4 + 7?

2026-03-21 09:14:45

Alex Blakenburg

Note:
• From Excel 2021 on Sum would have worked instead of SumProduct
• IsText will include empty strings ie any formula results returning ""
• IsBlank will not include empty strings


2026-03-21 09:10:17

Alex Blakenburg

@Wim Excel - the double minus signs are normally referred to as the "double unary" operator. The ISTEXT or ISNUMBER with a range in the brackets returns an array of TRUEs and FALSEs.
For SumProduct to add them up they need to be converted to 1s and 0s respectively. Any arithmetic operation will achieve this conversion.
So these would also have worked ISTEXT(A2:A123)+0 or ISTEXT(A2:A123)*1. Minus Minus has a similar affect turning True into -1 then back to 1. Mostly people think it looks neater but I also once read that it is faster but don't quote me on that.


2026-03-21 05:27:16

Wim Excel

Thanks for this tip. What do the -- (double minus signs) do in the second version?


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.