What does the "-{1,7}" do in conjunction with SUM

D

David

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.
 
T

T. Valko

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
 
D

David

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

T. Valko

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top