Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rob
 
Posts: n/a
Default No of W/E between 2 dates

Hi group,

Is there a formula that can extract the number of weekends between 2
variable dates?

Rob


  #2   Report Post  
Domenic
 
Posts: n/a
Default

Try the following...

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

....where A1 contains the start date and B1 contains the end date.

Hope this helps!

In article , "Rob"
wrote:

Hi group,

Is there a formula that can extract the number of weekends between 2
variable dates?

Rob

  #3   Report Post  
Rob
 
Posts: n/a
Default

Thankyou so much Domenic and so quick too!
I just need to amend it slightly as your formula does No. of week-end days
and not No. of week-ends.

Rob
"Domenic" wrote in message
...
Try the following...

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

...where A1 contains the start date and B1 contains the end date.

Hope this helps!

In article , "Rob"
wrote:

Hi group,

Is there a formula that can extract the number of weekends between 2
variable dates?

Rob



  #4   Report Post  
tjtjjtjt
 
Posts: n/a
Default

Another way:
=SUMPRODUCT(--(WEEKDAY(A1:A31)=1),--(A1:A31B1),--(A1:A31<B2))+SUMPRODUCT(--(WEEKDAY(A1:A31)=7),--(A1:A31B1),--(A1:A31<B2))

(It should all be on one line)
I put the list of dates in A1:A31 and the between dates are stored in B1 and
B2.
For an explanation of SUMPRODUCT:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

tj




"Rob" wrote:

Hi group,

Is there a formula that can extract the number of weekends between 2
variable dates?

Rob



  #5   Report Post  
Domenic
 
Posts: n/a
Default

In article ,
"Rob" wrote:

Thankyou so much Domenic and so quick too!
I just need to amend it slightly as your formula does No. of week-end days
and not No. of week-ends.


I had wondered about that...obviously I guessed wrong...so here you
go... :-)

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&B1-1)),2)=6),--(WEEKDAY(ROW(IN
DIRECT(A1+1&":"&B1)),2)=7))

Hope this helps!


  #6   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Mon, 20 Dec 2004 10:56:15 +1030, "Rob" wrote:

Hi group,

Is there a formula that can extract the number of weekends between 2
variable dates?

Rob


If you have the Analysis Tool Pak installed, then:

=(A2-A1-networkdays(A1,A2)+1)/2

============================
If the NETWORKDAYS function is not available, and returns the #NAME? error,
install and load the Analysis ToolPak add-in.

How?

On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click
OK.
If necessary, follow the instructions in the setup program.

--ron
  #7   Report Post  
Rob
 
Posts: n/a
Default

Thanks again Domenic. In reflection, your first formula will actually do me
better, but thanks for the amendment as may help me with another issue.
Unfortunately, the environment this will be used in is at my office and they
don't use Excel. Strange but true! They use Quattro Pro....ugg! That
program uses all but the Indirect function. Is there another way to do this
without that function?
BTW it works just great in Excel
PS. I tried fiddling with a later post by pj but his formula comes up with
syntax error in Quattro. Nor can I use the Analysis Toolpak as suggested by
Ron

Rob

"Domenic" wrote in message
...
In article ,
"Rob" wrote:

Thankyou so much Domenic and so quick too!
I just need to amend it slightly as your formula does No. of week-end

days
and not No. of week-ends.


I had wondered about that...obviously I guessed wrong...so here you
go... :-)

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&B1-1)),2)=6),--(WEEKDAY(ROW(IN
DIRECT(A1+1&":"&B1)),2)=7))

Hope this helps!



  #8   Report Post  
Rob
 
Posts: n/a
Default

Thanks Ron. I'm sure this would work fine, but unfortunately I need to get
this working on a Quattro Pro spreadsheet. I was hoping for a formula I
could amend to suit and without having to install addins.

Rob

"Ron Rosenfeld" wrote in message
...
On Mon, 20 Dec 2004 10:56:15 +1030, "Rob" wrote:

Hi group,

Is there a formula that can extract the number of weekends between 2
variable dates?

Rob


If you have the Analysis Tool Pak installed, then:

=(A2-A1-networkdays(A1,A2)+1)/2

============================
If the NETWORKDAYS function is not available, and returns the #NAME?

error,
install and load the Analysis ToolPak add-in.

How?

On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then

click
OK.
If necessary, follow the instructions in the setup program.

--ron



  #9   Report Post  
Rob
 
Posts: n/a
Default

Thanks tj, but I'm trying to make this formula work within a Quattro Pro
worksheet without success. Comes up with Syntax error. I'm not too
familiar with Quattro, but a lot of the functions are the same so I was
hoping for a formula that I could amend to suit that program.
I don't know where to go to get help for Quattro Pro users and as this
newsgroup is so good I hoped that someone here might be able to help. I
should have mentioned this at the start, eh!

Can someone help a sad Quattro user?

Rob

"tjtjjtjt" wrote in message
...
Another way:

=SUMPRODUCT(--(WEEKDAY(A1:A31)=1),--(A1:A31B1),--(A1:A31<B2))+SUMPRODUCT(--
(WEEKDAY(A1:A31)=7),--(A1:A31B1),--(A1:A31<B2))

(It should all be on one line)
I put the list of dates in A1:A31 and the between dates are stored in B1

and
B2.
For an explanation of SUMPRODUCT:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

tj




"Rob" wrote:

Hi group,

Is there a formula that can extract the number of weekends between 2
variable dates?

Rob





  #10   Report Post  
tjtjjtjt
 
Posts: n/a
Default

Have you tried a Quattro Pro newsgroup? I've haven't had need to go to it,
but here is a place you could try:
http://support.corel.com/scripts/rig...p_faqid=754345

tj

"Rob" wrote:

Thanks again Domenic. In reflection, your first formula will actually do me
better, but thanks for the amendment as may help me with another issue.
Unfortunately, the environment this will be used in is at my office and they
don't use Excel. Strange but true! They use Quattro Pro....ugg! That
program uses all but the Indirect function. Is there another way to do this
without that function?
BTW it works just great in Excel
PS. I tried fiddling with a later post by pj but his formula comes up with
syntax error in Quattro. Nor can I use the Analysis Toolpak as suggested by
Ron

Rob

"Domenic" wrote in message
...
In article ,
"Rob" wrote:

Thankyou so much Domenic and so quick too!
I just need to amend it slightly as your formula does No. of week-end

days
and not No. of week-ends.


I had wondered about that...obviously I guessed wrong...so here you
go... :-)

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&B1-1)),2)=6),--(WEEKDAY(ROW(IN
DIRECT(A1+1&":"&B1)),2)=7))

Hope this helps!






  #11   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Mon, 20 Dec 2004 18:34:40 +1030, "Rob" wrote:

Thanks Ron. I'm sure this would work fine, but unfortunately I need to get
this working on a Quattro Pro spreadsheet. I was hoping for a formula I
could amend to suit and without having to install addins.


Probably you'd get better advice from a QP news group.


--ron
  #12   Report Post  
Domenic
 
Posts: n/a
Default

In article ,
"Rob" wrote:

They use Quattro Pro....ugg! That
program uses all but the Indirect function. Is there another way to do this
without that function?


Not that I'm aware of...as others have suggested, you may want to seek
help in the Quattro Pro newsgroup.

Cheers!
  #13   Report Post  
Rob
 
Posts: n/a
Default

Thanks tj. I didn't think there would be such a group. I'll try there.

Rob

"tjtjjtjt" wrote in message
...
Have you tried a Quattro Pro newsgroup? I've haven't had need to go to it,
but here is a place you could try:
http://support.corel.com/scripts/rig...p_faqid=754345

tj

"Rob" wrote:

Thanks again Domenic. In reflection, your first formula will actually do
me
better, but thanks for the amendment as may help me with another issue.
Unfortunately, the environment this will be used in is at my office and
they
don't use Excel. Strange but true! They use Quattro Pro....ugg! That
program uses all but the Indirect function. Is there another way to do
this
without that function?
BTW it works just great in Excel
PS. I tried fiddling with a later post by pj but his formula comes up
with
syntax error in Quattro. Nor can I use the Analysis Toolpak as suggested
by
Ron

Rob

"Domenic" wrote in message
...
In article ,
"Rob" wrote:

Thankyou so much Domenic and so quick too!
I just need to amend it slightly as your formula does No. of week-end

days
and not No. of week-ends.

I had wondered about that...obviously I guessed wrong...so here you
go... :-)

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&B1-1)),2)=6),--(WEEKDAY(ROW(IN
DIRECT(A1+1&":"&B1)),2)=7))

Hope this helps!






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
Ploting dates against a calendar and not as a simple events Barb Reinhardt Charts and Charting in Excel 2 January 22nd 05 02:41 AM
Dates Subtracting dates. help me Excel Discussion (Misc queries) 4 December 17th 04 03:48 AM
Can I get email alerts when dates in excel are nearing? lucrecat Excel Discussion (Misc queries) 2 December 14th 04 05:14 AM
Dates pjd Excel Discussion (Misc queries) 3 December 8th 04 03:44 AM
Dates in spreadsheets Robert Newman Excel Discussion (Misc queries) 2 December 2nd 04 10:03 AM


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

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"