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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

GorD

Well-known Member
Joined
Jan 17, 2004
Messages
1,446
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.
 

Fin Fang Foom

Well-known Member
Joined
Mar 20, 2005
Messages
598
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
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
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
 

Fin Fang Foom

Well-known Member
Joined
Mar 20, 2005
Messages
598
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!
 

Forum statistics

Threads
1,141,718
Messages
5,708,074
Members
421,545
Latest member
TWR

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
Top