How to count number of cells/rows until first blank in Excel?
Author: SunLast Modified: 2016-08-19
For instance, you have a list of data including some blanks in a sheet, and what you want to do is to count the number of cells until blank cell, and the recount the below cells as following screenshot shown. In this article, I introduce formulas to quickly solve this job in Excel. Count number of cells/rows until blank with formula
Count times a word appears
If you want to count the times a specific word appears in a single cell or a range, you can try Count times a word appears of Kutools for Excel, it may make a big favor for you.
Count number of cells/rows until blank with formula
Select a blank cell next to the cells you want to count, and enter this formula =MIN(IF(A1:A12="",ROW(A1:A12)-ROW(A1)+1))-1, press Shift + Ctrl + Enter key to get the correct result, and then drag auto fill handle over the cells you need to apply this formula. See screenshot:
Tip:
1. You also can also apply this formula =MATCH(1,--(A1:A12=""),0)-1 and press Shift + Ctrl + Enter keys simultaneously to count the cells until a blank cell.
2. In above formulas, A1 is the first cell in the list you want to count, and A1:A12 is the list you want to count from.
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
This comment was minimized by the moderator on the site
Hi Team,
When applying this formula:
=MIN(IF(A1:A12="",ROW(A1:A12)-ROW(A1)+1))-1
I find that it counts the number of rows from the FIRST blank cell not the NEXT blank cell like it does in your example (where the number seems to reset with each blank cell).