Count how many weeks in a range

Fin Fang Foom

Well-known Member
Joined
Mar 20, 2005
Messages
598
I would like to count how many weeks in a range. Example look in column B there are 4 weeks in that range.
Book2
ABCDEFG
1Expected resultExpected result
29-01-200649-01-20061
39-11-20069-02-2006
49-18-20069-03-2006
59-28-20069-04-2006
6
7
8
9
Sheet1
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Can you explain your definition of week.

Is it multiples of 7 days, or is a Sunday in a different week from a Saturday etc.
 
Upvote 0
Thank You for replying GorD,



I use a helper column to solve my question. To bad there is not a all in one formula for this.

Thanks anyway.
Book1
ABCDEFGHI
1Expected resultExpected result
29-01-20063549-01-2006352
39-11-2006379-02-200635
49-18-2006389-03-200636
59-28-2006399-04-200636
6
7
Sheet1
 
Upvote 0
To bad there is not a all in one formula for this.

Try this formula in D2

=COUNT(1/FREQUENCY(INT((B2:B5-DATE(YEAR(B2:B5),1,1)-WEEKDAY(B2:B5))/7)+2,ROW(INDIRECT("1:53"))))

confirmed with CTRL+SHIFT+ENTER
 
Upvote 0
To bad there is not a all in one formula for this.

Try this formula in D2

=COUNT(1/FREQUENCY(INT((B2:B5-DATE(YEAR(B2:B5),1,1)-WEEKDAY(B2:B5))/7)+2,ROW(INDIRECT("1:53"))))

confirmed with CTRL+SHIFT+ENTER



Perfect!! Thank you so much barry houdini!
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

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