count days

G

giorgio

How I can construct a "count" that gives back to the sum, month by month, of
all the wednesdays and saturdays until the day of calender ?
ex if day is 10/07/04 = result 3, if 29/07/04 = 8, if 10/08/04 = 2, if
23/09/04 = 7, if 13/10/04 = 4, ...etc naturally control the result the same
day of the calendar ex today(10/07/04) =3.

Thanks
 
F

Frank Kabel

Hi
try the following:
1. In A1 enter this date (e.g. 10/07/04)
2. In A2 enter a formula to calculate the first day of this month:
=DATE(YEAR(A1),MONTH(A1),1)
3. Enter the following formula to calculate the number of Saturdays and
Wednesdays:
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2 & ":" & A1)))={4,7}))
 
G

giorgio

3. Result = 0 ?



Frank Kabel said:
Hi
try the following:
1. In A1 enter this date (e.g. 10/07/04)
2. In A2 enter a formula to calculate the first day of this month:
=DATE(YEAR(A1),MONTH(A1),1)
3. Enter the following formula to calculate the number of Saturdays and
Wednesdays:
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2 & ":" & A1)))={4,7}))
 
F

Frank Kabel

Hi
works for me. Have you entered the date values in cell A1 and A2? And
what exact formulas have you entered?
 
G

giorgio

Ctrl C Ctrl V
Which are yor setting: office and regional and language options
i think the problem is {4,7}

regards
thanks
 
P

Peo Sjoblom

Try

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2 & ":" & A1)))={4;7}))

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
F

Frank Kabel

Hi
now depending on your settings try
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2 & ":" & A1)))={4.7}))

(this works if the semicolon is used as delimiert -> the dot is used
for these arrays). What language version of Excel are you using?
 

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