Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default What does the "-{1,7}" do in conjunction with SUM

Gidday

I am seeking a bit of help with what the "-{1,7}" does/means in the
following formula;
=ABS(IF((DATE(YEAR(C3),MONTH(C3)+1,DAY(C3))),(C3)-(DATE(YEAR(C3),MONTH(C3)+1,DAY(C3)))-SUM(INT((WEEKDAY((DATE(YEAR(C3),MONTH(C3)+1,DAY(C3 )))-{1,7})+(C3)-(DATE(YEAR(C3),MONTH(C3)+1,DAY(C3))))/7)),""))

The forumal works out the number of workdays in a month where C3= 1/1/2007
and the return answer is 20

I look forward to your responses.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default What does the "-{1,7}" do in conjunction with SUM

It's subtracting 1 and 7 in order to count the number of Sundays (weekday 1)
and Saturdays (weekday 7) in the month.

That formula can be replaced with:

=NETWORKDAYS(C3,DATE(YEAR(C3),MONTH(C3)+1,0))

With C3 = 1/1/2007

The result is 23 with both formulas.

Biff

"David" wrote in message
...
Gidday

I am seeking a bit of help with what the "-{1,7}" does/means in the
following formula;
=ABS(IF((DATE(YEAR(C3),MONTH(C3)+1,DAY(C3))),(C3)-(DATE(YEAR(C3),MONTH(C3)+1,DAY(C3)))-SUM(INT((WEEKDAY((DATE(YEAR(C3),MONTH(C3)+1,DAY(C3 )))-{1,7})+(C3)-(DATE(YEAR(C3),MONTH(C3)+1,DAY(C3))))/7)),""))

The forumal works out the number of workdays in a month where C3= 1/1/2007
and the return answer is 20

I look forward to your responses.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default What does the "-{1,7}" do in conjunction with SUM

OK! ... thankyou ... Biff ... I think I understand ... it is like an array of
variables to be used in a formula?

"T. Valko" wrote:

It's subtracting 1 and 7 in order to count the number of Sundays (weekday 1)
and Saturdays (weekday 7) in the month.

That formula can be replaced with:

=NETWORKDAYS(C3,DATE(YEAR(C3),MONTH(C3)+1,0))

With C3 = 1/1/2007

The result is 23 with both formulas.

Biff

"David" wrote in message
...
Gidday

I am seeking a bit of help with what the "-{1,7}" does/means in the
following formula;
=ABS(IF((DATE(YEAR(C3),MONTH(C3)+1,DAY(C3))),(C3)-(DATE(YEAR(C3),MONTH(C3)+1,DAY(C3)))-SUM(INT((WEEKDAY((DATE(YEAR(C3),MONTH(C3)+1,DAY(C3 )))-{1,7})+(C3)-(DATE(YEAR(C3),MONTH(C3)+1,DAY(C3))))/7)),""))

The forumal works out the number of workdays in a month where C3= 1/1/2007
and the return answer is 20

I look forward to your responses.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default What does the "-{1,7}" do in conjunction with SUM

it is like an array of variables to be used in a formula?

Yes. Those would be called array constants. Whenever you see {x,y,z}, the
squiggly brackets mean it's an array.

Biff

"David" wrote in message
...
OK! ... thankyou ... Biff ... I think I understand ... it is like an array
of
variables to be used in a formula?

"T. Valko" wrote:

It's subtracting 1 and 7 in order to count the number of Sundays (weekday
1)
and Saturdays (weekday 7) in the month.

That formula can be replaced with:

=NETWORKDAYS(C3,DATE(YEAR(C3),MONTH(C3)+1,0))

With C3 = 1/1/2007

The result is 23 with both formulas.

Biff

"David" wrote in message
...
Gidday

I am seeking a bit of help with what the "-{1,7}" does/means in the
following formula;
=ABS(IF((DATE(YEAR(C3),MONTH(C3)+1,DAY(C3))),(C3)-(DATE(YEAR(C3),MONTH(C3)+1,DAY(C3)))-SUM(INT((WEEKDAY((DATE(YEAR(C3),MONTH(C3)+1,DAY(C3 )))-{1,7})+(C3)-(DATE(YEAR(C3),MONTH(C3)+1,DAY(C3))))/7)),""))

The forumal works out the number of workdays in a month where C3=
1/1/2007
and the return answer is 20

I look forward to your responses.






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
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
create links to check boxes marked "good" fair"and "bad" pjb Excel Worksheet Functions 3 April 20th 06 02:17 AM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


All times are GMT +1. The time now is 07:05 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"