# Count Cells in Excel Formula Learn the count cells in Excel formula. Use our guide to learn how to count cells in a range in an Excel spreadsheet, along with how to retrieve a number specific to entry data.

Open up your downloaded example spreadsheet and you will see a contact list containing names, emails, phone numbers, and the state the person resides in. Your goal is to count the total number of cells that contain text in this spreadsheet. From there, you can also learn how to isolate certain text and retrieve the number of cells containing that certain text.

To start, go to cell B20 and input the total number of rows and columns you want to retrieve information from. The formula will look like this:

=ROWS(B6:E15)*COLUMNS(B6:E15)

Hit enter and your result should be “40”. You can adjust the cells referenced by changing the rows and columns in the formula to only scan a portion of the spreadsheet.

Now you can learn the Countif function that will isolate text in the spreadsheet and retrieve for you the number of cells containing that text. To do this in the example, go to cell C20 and enter this formula:

=COUNTIF(B6:15,”CA”)

This formula is specifically looking for cells that contain the text “CA”, so the number of contacts listed as being in California. The number retrieved should be three.

You can now use these formulas to retrieve all sorts of data numbers, such as how many of your contacts are from a certain area, or how many employees work in a department. Try changing the cell range numbers to get different results.