Help counting nonblank cells

theScragg

New Member
Joined
Oct 17, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have an issue trying to get a formula to count the number of nonblank cells between two words in the same column. Here is a sample of the data I'm working with.

Eg.
Dates
Oct 12
Oct 13
[blank]
[blank]
[blank]
Dates
Oct 7
[blank]
[blank]
Dates

I am trying to use a formula to tell me how many dates are for each account in column that contains hundreds of accounts. I have a formula that can tell me the number of lines between each instance of the word "Dates" but since the intervals are not the same between the "Dates" (due to other information elsewhere) this information isn't helpful. This is the formula I was using: =IF($O11="Date(s)", MATCH("Date(s)",$O12:$O30,0),"")

I think I need something like COUNTA, COUNTIF or ISBLANK, but I'm not sure how to implement it to work. When I've tried, the output is always just 1, which means its only counting how many "Dates" exist between the starting word and the word it's counting.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Is this what you need?

Book1.xlsx
AB
1Dates2
212-Oct 
313-Oct 
4 
5 
6 
7Dates1
87-Oct 
9 
10 
11Dates0
Sheet1
Cell Formulas
RangeFormula
B1:B11B1=IF(A1="Dates",COUNTA(A2:INDEX(A2:$A$5500,MATCH("Dates",A2:$A$5500,0)))-1,"")
 
Upvote 0
Thank you so much. I'm going to figure out where my logic went wrong based on your formula
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top