ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Calculating the number of a Mondays between two dates (https://www.excelbanter.com/excel-discussion-misc-queries/174361-calculating-number-mondays-between-two-dates.html)

AChua

Calculating the number of a Mondays between two dates
 
Is there a function which can calculate the number of a specified weekday
between two dates?
e.g. How many Mondays there are between 01/07/08 and 01/08/08?



Teethless mama

Calculating the number of a Mondays between two dates
 
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=2))


"AChua" wrote:

Is there a function which can calculate the number of a specified weekday
between two dates?
e.g. How many Mondays there are between 01/07/08 and 01/08/08?



Ron Rosenfeld

Calculating the number of a Mondays between two dates
 
On Thu, 24 Jan 2008 16:16:20 -0800, AChua
wrote:

Is there a function which can calculate the number of a specified weekday
between two dates?
e.g. How many Mondays there are between 01/07/08 and 01/08/08?


In general:

=INT((A2-WEEKDAY(A2+1-DOW)-A1+8)/7)


Where

A2: End Date
A1: Start DAte
DOW: Day of week (Sun=1, Mon=2, ...)
--ron


All times are GMT +1. The time now is 03:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com