COUNTA for a dynamic range

cherry_pie

New Member
Joined
Aug 15, 2006
Messages
29
Office Version
  1. 365
Platform
  1. Windows
For each row in a worsheet, I want to count the number of cells with text in them. I know the basic formula for doing the count using stable cell references [ie =COUNTA(D2:E2], but I want to make the range start from the column with today's date in it, and finish in 14 days time, so I get the count for the next 14 days.

I have used Match in a formula to return the column number that has today's date in it, but I don't really know how to progress here and I'm clearly not googling the right phrases to find the answer.

Any help would be appreciated. If it isn't possible, or requires VBA then I can find a workaround, but I'm keen to see if it is possible and improve my knowlege.
Also happy to be directed to previous posts / guidance articles if that's easier.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also does row 1 have the dates?
 
Upvote 0
Hi,
Thanks for such a speedy reply.
Updated my profile as requested.
The dates are in row 7, and start quite a few columns over, say F7.
 
Upvote 0
Thanks for that, how about
+Fluff 1.xlsm
CDEFGHIJKLMNOPQRSTUVW
717/10/202118/10/202119/10/202120/10/202121/10/202122/10/202123/10/202124/10/202125/10/202126/10/202127/10/202128/10/202129/10/202130/10/202131/10/202101/11/202102/11/202103/11/2021
812abcegijklmnopqr
Main
Cell Formulas
RangeFormula
C8C8=COUNT(FILTER(COLUMN(F8:W8),(F7:W7>=TODAY())*(F7:W7<=TODAY()+14)*(F8:W8<>"")))
 
Upvote 0
Is that how your data is laid out?
 
Upvote 0
Yes, other than it has multiple columns and I need a count for each row, how many cells in the next 14 days have a character in them.
It is formatted as a table also.
I have just changed it from a table to a normal range (as I was writing this reply), and it works now.
 
Upvote 0
If the dates are the header row in a table then they are text & not real dates, which is why it didn't work.
 
Upvote 0
Ahh, thank you. I wasn't aware it considered them like that, so that's really helpful to know for now and in the future.
Your help is much appreciated.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,775
Members
448,991
Latest member
Hanakoro

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