CountA with a Dynamic Range

Swytek

New Member
Joined
Aug 26, 2019
Messages
2
I am trying to determine the number of active months for personnel on a rolling 12 month basis. This is the formula I'm currently using but am getting an incorrect result value. I'm new to offset so I know I must be missing something simple.

=COUNTA(OFFSET(D2,0,COUNTA(D2:AA2),1,-12))
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You're going to need to supply an example of what you are trying to do.

If you are short by 1 value it's because your offset is starting in Column AB. Try this =COUNTA(OFFSET(D2,0,COUNTA(D2:AA2)-1,1,-12))

If that solves the problem great, if not I'll need to see some sample data to understand what you're trying to do.

Another tip: create the formula the way you know it will be right. Just do a CountA over the range you want, then duplicate it using the more complex formula. That way you can catch the "simple" errors in formulas you think you know like the back of you hand.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,580
Members
448,972
Latest member
Shantanu2024

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