Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 138
Default Figuring number of Mon. Tues. Wed between dates

Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Figuring number of Mon. Tues. Wed between dates

=SUM(IF(WEEKDAY(ROW(INDIRECT("$1:$"&enddate-startdate+1))+$F$2-1)=3,1,0))
Change the =3 to 2 for Mondays and 4 for Wednesdays.

This is an **array** formula. After typing the formula, instead of pressing
just ENTER, press CTRL+SHIFT+ENTER.
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"Paula" wrote:

Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Figuring number of Mon. Tues. Wed between dates

One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Figuring number of Mon. Tues. Wed between dates

I've been on an array formula kick, but I like your formula, but you might
wanna change the A151 in the INDIRECT statement to B1 :)
--
** John C **

"T. Valko" wrote:

One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Figuring number of Mon. Tues. Wed between dates

and of course, the =2 needs to be changed to =3, where 3=Tuesday :)
--
** John C **


"T. Valko" wrote:

One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Figuring number of Mon. Tues. Wed between dates

nevermind on this part :), but i stand by the A151 to B1 correction :)
--
** John C **

"John C" wrote:

and of course, the =2 needs to be changed to =3, where 3=Tuesday :)
--
** John C **


"T. Valko" wrote:

One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Figuring number of Mon. Tues. Wed between dates

change the A151 in the INDIRECT statement to B1 :)

Ooops!

Thanks for catching that!


--
Biff
Microsoft Excel MVP


"John C" <johnc@stateofdenial wrote in message
...
I've been on an array formula kick, but I like your formula, but you might
wanna change the A151 in the INDIRECT statement to B1 :)
--
** John C **

"T. Valko" wrote:

One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks






  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Figuring number of Mon. Tues. Wed between dates

Typo...

A1 = start date
B1 = end date
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))


Formula should be:

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&B1)),2)=2))

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks





  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Figuring number of Mon. Tues. Wed between dates

Hi,

Here is another formula:

=SUMPRODUCT(--(MOD(ROW(INDIRECT(G23&":"&G24)),7)=3))
--
Thanks,
Shane Devenshire


"Paula" wrote:

Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Figuring number of Mon. Tues. Wed between dates

Here's a much more compact formula that does the same thing:

=INT((WEEKDAY(A1-n,2)+B1-A1)/7)

Where n = day of week: Monday =1 thru Sunday =7

I don't ever suggest it because I don't understand the logic behind it (and
no one has been able to explain it to me!) and if someone asks for an
explanation I won't have one! I don't post anything I can't explain.

--
Biff
Microsoft Excel MVP


"John C" <johnc@stateofdenial wrote in message
...
I've been on an array formula kick, but I like your formula, but you might
wanna change the A151 in the INDIRECT statement to B1 :)
--
** John C **

"T. Valko" wrote:

One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks








  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 138
Default Figuring number of Mon. Tues. Wed between dates

Thanks so much. I have tried both formulas and I am not doing something
correct. I have the beginning date in A1 and the end date in B1. I am not
seeing where B1 is referenced. I changed A151 to B1 but it did not work. I
actually do not understand the formula such as -- but of course that is OK if
I can just get it to work. I am getting a REF error. This is the formula in
A4. I have copied it =SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))
Sorry for the confusion.

"T. Valko" wrote:

One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks




  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 138
Default Figuring number of Mon. Tues. Wed between dates

It worked I changed the A151 to A2 which is where I have the end date. Thanks
so much.

"T. Valko" wrote:

One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks




  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Figuring number of Mon. Tues. Wed between dates

Good deal. Sorry about the confusion caused by my typo.

Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
It worked I changed the A151 to A2 which is where I have the end date.
Thanks
so much.

"T. Valko" wrote:

One way...

A1 = start date
B1 = end date

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A151)),2)=2))

Where =2 means the 2nd day of the week = Tuesday

--
Biff
Microsoft Excel MVP


"Paula" wrote in message
...
Course begins January 1, 2008
Course ends May 30, 2008
How many Tuesdays are there. Of course the dates will change.
Thanks






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Figuring Age Sue Excel Worksheet Functions 2 March 18th 08 05:51 PM
I want to count the total Number of dates between two dates How? seshu Excel Worksheet Functions 3 February 7th 08 05:41 PM
Calculating number of days between two dates that fall between two other dates [email protected] Excel Discussion (Misc queries) 5 October 26th 05 06:18 PM
In excel how set up a sequence to drag Mon, Tues, Wed Etc, miltdp Excel Discussion (Misc queries) 1 August 3rd 05 10:15 PM
Need number of Saturdays and number of Sundays between 2 dates Class316 Excel Worksheet Functions 1 June 10th 05 02:47 AM


All times are GMT +1. The time now is 08:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"