Counting Total Cells (Blank and Filled) Between Dates

magnethero

New Member
Joined
Apr 25, 2018
Messages
6
Hello all,

First time posting in an Excel forum and I have been racking my brain for the last two days trying to get this to work. My goal is that I'm trying to create a summary page for all departments of a large series of information for years back. To start I want to count the number of cells between each year (always in the same column) but because the information is always added to the top, the data shows something like this:

Dept #
2018Dept Name
Staff TypeStaff TypeStaff Type
Sum ValueSum ValueSum Value
ChangesMergedMergedMergedValue Change
2017

<tbody>
</tbody>

The cells between the year values are a mix of filled, blank, and merged cells and the years go in reverse order. I'm not sure how to tackle this. Some ideas were to use a =countifs() with a > and < range of the years but this failed because of the reverse order of the years.

The largest hurdle is I need it to count at the next change in year. If it counted all the values between 2018 and say 2015, the summary wouldn't work properly as it would show amounts only valid for the whole change in company. If anyone has any suggestions, please let me know!

Thank you.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
A
B
C
D
E
F
G
H
I
1
2
Dept #Cells between years:
3
2018​
Dept Name
2018​
5​
4
Staff TypeStaff TypeStaff Type
2017​
2​
5
Sum ValueSum ValueSum Value
2016​
3​
6
2015​
7
ChangesMergedMergedMergedValue Change
8
9
2017​
10
11
12
2016​
13
14
15
16
2015​
17
Sheet: Sheet19

Formula in cell H3:
=MATCH(G4,$B$1:$B$21,0)-MATCH(G3,$B$1:$B$21,0)-1

Copy cell H3 and paste to cells below as far as needed.
 
Upvote 0

Forum statistics

Threads
1,216,058
Messages
6,128,532
Members
449,456
Latest member
SammMcCandless

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