Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Simon Heaven
 
Posts: n/a
Default Complex Date Functions

Hi, I have two dates (E8 = 17/02/05 & E9 =26/02/05).
I want to know how many days in that range are Fridays, Saturdays or Sundays
as I am building a work schedule to calcuate days not worked and men only
work Mon to Thursday.
I need to use standard excel functions as the workbook must be compatiable
on all computer (even without toolpak installed).
Any idea would be appreciated.

Thanks
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

One way

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(E8&":"&E9)),2)=5))

totals 5 which is correct

to get the non fri-sun days use

=1+E9-E8-SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(E8&":"&E9)),2)=5))

format as general or else you probably get a weird date


--

Regards,

Peo Sjoblom

"Simon Heaven" <Simon wrote in message
...
Hi, I have two dates (E8 = 17/02/05 & E9 =26/02/05).
I want to know how many days in that range are Fridays, Saturdays or

Sundays
as I am building a work schedule to calcuate days not worked and men only
work Mon to Thursday.
I need to use standard excel functions as the workbook must be compatiable
on all computer (even without toolpak installed).
Any idea would be appreciated.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 39
Default Complex Date Functions

i have a problem with this, cause I Dont Know what to do, in my case i have
the following formula, cell E8 = TODAY() & E9 = TODAY() + E10

"Peo Sjoblom" wrote:

One way

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(E8&":"&E9)),2)=5))

totals 5 which is correct

to get the non fri-sun days use

=1+E9-E8-SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(E8&":"&E9)),2)=5))

format as general or else you probably get a weird date


--

Regards,

Peo Sjoblom

"Simon Heaven" <Simon wrote in message
...
Hi, I have two dates (E8 = 17/02/05 & E9 =26/02/05).
I want to know how many days in that range are Fridays, Saturdays or

Sundays
as I am building a work schedule to calcuate days not worked and men only
work Mon to Thursday.
I need to use standard excel functions as the workbook must be compatiable
on all computer (even without toolpak installed).
Any idea would be appreciated.

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Complex Date Functions

i have a problem with this, cause I Dont Know
what to do, in my case i have the following formula,
cell E8 = TODAY() & E9 = TODAY() + E10


What's the problem?

The formula should work if you have those formulas in E8 and E9.


--
Biff
Microsoft Excel MVP


"Victor" wrote in message
...
i have a problem with this, cause I Dont Know what to do, in my case i have
the following formula, cell E8 = TODAY() & E9 = TODAY() + E10

"Peo Sjoblom" wrote:

One way

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(E8&":"&E9)),2)=5))

totals 5 which is correct

to get the non fri-sun days use

=1+E9-E8-SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(E8&":"&E9)),2)=5))

format as general or else you probably get a weird date


--

Regards,

Peo Sjoblom

"Simon Heaven" <Simon wrote in message
...
Hi, I have two dates (E8 = 17/02/05 & E9 =26/02/05).
I want to know how many days in that range are Fridays, Saturdays or

Sundays
as I am building a work schedule to calcuate days not worked and men
only
work Mon to Thursday.
I need to use standard excel functions as the workbook must be
compatiable
on all computer (even without toolpak installed).
Any idea would be appreciated.

Thanks






  #5   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this array formula entered with the key combo of
CTRL,SHIFT,ENTER:

=SUM(N(WEEKDAY(ROW(INDIRECT(E8&":"&E9)))={1,5,6}))

Biff

-----Original Message-----
Hi, I have two dates (E8 = 17/02/05 & E9 =26/02/05).
I want to know how many days in that range are Fridays,

Saturdays or Sundays
as I am building a work schedule to calcuate days not

worked and men only
work Mon to Thursday.
I need to use standard excel functions as the workbook

must be compatiable
on all computer (even without toolpak installed).
Any idea would be appreciated.

Thanks
.



  #6   Report Post  
Biff
 
Posts: n/a
Default

Ooops!

Should be:

=SUM(N(WEEKDAY(ROW(INDIRECT(E8&":"&E9)))={1,6,7}))

Biff

-----Original Message-----
Hi!

Try this array formula entered with the key combo of
CTRL,SHIFT,ENTER:

=SUM(N(WEEKDAY(ROW(INDIRECT(E8&":"&E9)))={1,5,6}) )

Biff

-----Original Message-----
Hi, I have two dates (E8 = 17/02/05 & E9 =26/02/05).
I want to know how many days in that range are Fridays,

Saturdays or Sundays
as I am building a work schedule to calcuate days not

worked and men only
work Mon to Thursday.
I need to use standard excel functions as the workbook

must be compatiable
on all computer (even without toolpak installed).
Any idea would be appreciated.

Thanks
.

.

  #7   Report Post  
Simon Heaven
 
Posts: n/a
Default

Many thanks to both of you. Both methods worked perfectly and I can only say
thank you for such a prompt and accurate reply.
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
date and time ladimples247 New Users to Excel 2 February 16th 05 08:52 PM
Date issue between Windows and Macintosh version dlg1967 Excel Discussion (Misc queries) 4 January 19th 05 03:51 PM
Need help troubleshooting an array formula XLXP on Win2K KR Excel Worksheet Functions 1 December 13th 04 07:41 PM
Using formulas to determine date in one cell based on date in anot Gary Excel Worksheet Functions 2 November 22nd 04 08:11 AM
How do I create complex functions? Chris Excel Worksheet Functions 2 November 1st 04 12:28 AM


All times are GMT +1. The time now is 07:15 AM.

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

About Us

"It's about Microsoft Excel"