ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count Saturdays in a List (https://www.excelbanter.com/excel-worksheet-functions/127396-count-saturdays-list.html)

H

Count Saturdays in a List
 
Hi,

I need to count the number of Saturdays in an array of dates. I used the
following approach, which didn't work. Does anyone have another idea?

{=SUM(IF((WEEKDAY(array1,2)=7),1,0))}

Thanks!

vezerid

Count Saturdays in a List
 
{=SUM(IF((WEEKDAY(array1,2)=6),1,0))}

or

{=SUM(IF((WEEKDAY(array1,1)=7),1,0))}

HTH
Kostis Vezerides


H wrote:
Hi,

I need to count the number of Saturdays in an array of dates. I used the
following approach, which didn't work. Does anyone have another idea?

{=SUM(IF((WEEKDAY(array1,2)=7),1,0))}

Thanks!



Ron Coderre

Count Saturdays in a List
 
Try something like this:

With dates in A1:A100

This formula counts the number of Saturdays
=SUMPRODUCT(--(WEEKDAY(A1:A100)=7))

Or....if some of the cells may be blank:
=SUMPRODUCT(--((A1:A1000)*(WEEKDAY(A1:A100)=7)))
Does that help?
***********
Regards,
Ron

XL2002, WinXP


"H" wrote:

Hi,

I need to count the number of Saturdays in an array of dates. I used the
following approach, which didn't work. Does anyone have another idea?

{=SUM(IF((WEEKDAY(array1,2)=7),1,0))}

Thanks!


driller

Count Saturdays in a List
 
it looks you're aware of entering an array formula
lets see another idea maybe something like this
=SUM(--(WEEKDAY(A1:A20)=7))
hit ctrl-shft-ent..

--
*****
birds of the same feather flock together..



"H" wrote:

Hi,

I need to count the number of Saturdays in an array of dates. I used the
following approach, which didn't work. Does anyone have another idea?

{=SUM(IF((WEEKDAY(array1,2)=7),1,0))}

Thanks!


T. Valko

Count Saturdays in a List
 
=SUMPRODUCT(--(WEEKDAY(A1:A20)6))

Biff

"H" wrote in message
...
Hi,

I need to count the number of Saturdays in an array of dates. I used the
following approach, which didn't work. Does anyone have another idea?

{=SUM(IF((WEEKDAY(array1,2)=7),1,0))}

Thanks!




ShaneDevenshire

Count Saturdays in a List
 
And one mo

=SUM(IF(MOD(R,7),,1))

Array entered. Where R is a range name for your data.

--
Thanks,
Shane Devenshire


"T. Valko" wrote:

=SUMPRODUCT(--(WEEKDAY(A1:A20)6))

Biff

"H" wrote in message
...
Hi,

I need to count the number of Saturdays in an array of dates. I used the
following approach, which didn't work. Does anyone have another idea?

{=SUM(IF((WEEKDAY(array1,2)=7),1,0))}

Thanks!





daddylonglegs

Count Saturdays in a List
 
I think that

=SUM(IF(MOD(R,7),,1))

is a little dangerous, Shane. If you're using the 1904 date system it'll
count Fridays.......

"ShaneDevenshire" wrote:

And one mo

=SUM(IF(MOD(R,7),,1))

Array entered. Where R is a range name for your data.

--
Thanks,
Shane Devenshire


"T. Valko" wrote:

=SUMPRODUCT(--(WEEKDAY(A1:A20)6))

Biff

"H" wrote in message
...
Hi,

I need to count the number of Saturdays in an array of dates. I used the
following approach, which didn't work. Does anyone have another idea?

{=SUM(IF((WEEKDAY(array1,2)=7),1,0))}

Thanks!





ShaneDevenshire

Count Saturdays in a List
 
You can modify it to work with the 1904 date system. I don't suspect that a
lot of people on PC's use that? And maybe not even that many on the Mac.

=SUM(IF(MOD(R,7)=1,1))

--
Cheers,
Shane Devenshire


"daddylonglegs" wrote:

I think that

=SUM(IF(MOD(R,7),,1))

is a little dangerous, Shane. If you're using the 1904 date system it'll
count Fridays.......

"ShaneDevenshire" wrote:

And one mo

=SUM(IF(MOD(R,7),,1))

Array entered. Where R is a range name for your data.

--
Thanks,
Shane Devenshire


"T. Valko" wrote:

=SUMPRODUCT(--(WEEKDAY(A1:A20)6))

Biff

"H" wrote in message
...
Hi,

I need to count the number of Saturdays in an array of dates. I used the
following approach, which didn't work. Does anyone have another idea?

{=SUM(IF((WEEKDAY(array1,2)=7),1,0))}

Thanks!





All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com