#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Counting occurances

One of my students has a spreadsheet that they use for tracking employees
scheduled work days. Rows are the employees names, columns represent the day
of the week. The columns are repeating - Sunday through Saturday, over and
over to cover 3 months. Under the day of the week they enter a code that
signifies what shift was worked for that employee.

They want to know if there is a way to calculate how many times in that 3
month timeframe the employee worked each day of the week. So, how many
Sundays did Mary work in those three months? How many Mondays, etc.

Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting occurances

Are the day of week headers TEXT strings?

If a person did not work on a particular day is that cell left empty?

Try this:

B1:AQ1 = day of week headers as TEXT strings: Monday, Tuesday, etc
B2:AQ2 = shift code if worked, otherwise empty

To count the number of Mondays worked:

=SUMPRODUCT(--(B1:AQ1="Monday"),--(B2:AQ2<""))

Biff

"LauriS" wrote in message
...
One of my students has a spreadsheet that they use for tracking employees
scheduled work days. Rows are the employees names, columns represent the
day
of the week. The columns are repeating - Sunday through Saturday, over
and
over to cover 3 months. Under the day of the week they enter a code that
signifies what shift was worked for that employee.

They want to know if there is a way to calculate how many times in that 3
month timeframe the employee worked each day of the week. So, how many
Sundays did Mary work in those three months? How many Mondays, etc.

Is this possible?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 221
Default Counting occurances

Sum using multiple criteria:
http://www.officearticles.com/excel/...ft_excel.h tm
****************************
Hope it helps!
Anne Troy
www.OfficeArticles.com
****************************
"LauriS" wrote in message
...
One of my students has a spreadsheet that they use for tracking employees
scheduled work days. Rows are the employees names, columns represent the
day
of the week. The columns are repeating - Sunday through Saturday, over
and
over to cover 3 months. Under the day of the week they enter a code that
signifies what shift was worked for that employee.

They want to know if there is a way to calculate how many times in that 3
month timeframe the employee worked each day of the week. So, how many
Sundays did Mary work in those three months? How many Mondays, etc.

Is this possible?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Counting occurances

Biff,

THANKS!! That did the trick! I had never heard of the SUMPRODUCTS function
- learned something new!

Lauri

"T. Valko" wrote:

Are the day of week headers TEXT strings?

If a person did not work on a particular day is that cell left empty?

Try this:

B1:AQ1 = day of week headers as TEXT strings: Monday, Tuesday, etc
B2:AQ2 = shift code if worked, otherwise empty

To count the number of Mondays worked:

=SUMPRODUCT(--(B1:AQ1="Monday"),--(B2:AQ2<""))

Biff


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Counting occurances

Anne,

Thanks for the link!

Lauri

"Anne Troy" wrote:

Sum using multiple criteria:
http://www.officearticles.com/excel/...ft_excel.h tm
****************************
Hope it helps!
Anne Troy
www.OfficeArticles.com



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Counting occurances

=SUMPRODUCT(--(B1:AQ1="Monday"),--(B2:AQ2<""))

Ok, I'm confused. I did more research to understand the purpose of the --
and I thought I had it. But when I remove just one of the dashes I get the
same answer as when they are both there. I would have expected to get
negatives. Can anyone shed any light on this? I'm using 2000 if that makes
a difference.

Lauri
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Counting occurances

If you removed one of each pair of minuses, then when you previously
multiplied +1 by +1 in a TRUE/TRUE condition, you'll now be multiplying -1
by -1, and of course getting the same result. If you just remove one of the
four minus signs, I would expect to get a -ve result from the SUMPRODUCT.
--
David Biddulph

"LauriS" wrote in message
...
=SUMPRODUCT(--(B1:AQ1="Monday"),--(B2:AQ2<""))


Ok, I'm confused. I did more research to understand the purpose of the --
and I thought I had it. But when I remove just one of the dashes I get
the
same answer as when they are both there. I would have expected to get
negatives. Can anyone shed any light on this? I'm using 2000 if that
makes
a difference.

Lauri



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Counting occurances

I get it! Since I was multiplying two arrays that evaluated to T/F, it
wouldn't matter if I had both -- or just - in front of both arrays.

But if I was mutiplying a T/F array by actual numbers - THEN I would need to
use the --.

Thanks, David!

Lauri

"David Biddulph" wrote:

If you removed one of each pair of minuses, then when you previously
multiplied +1 by +1 in a TRUE/TRUE condition, you'll now be multiplying -1
by -1, and of course getting the same result. If you just remove one of the
four minus signs, I would expect to get a -ve result from the SUMPRODUCT.
--
David Biddulph

"LauriS" wrote in message
...
=SUMPRODUCT(--(B1:AQ1="Monday"),--(B2:AQ2<""))


Ok, I'm confused. I did more research to understand the purpose of the --
and I thought I had it. But when I remove just one of the dashes I get
the
same answer as when they are both there. I would have expected to get
negatives. Can anyone shed any light on this? I'm using 2000 if that
makes
a difference.

Lauri




  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting occurances

You're welcome. Thanks for the feedback!

SUMPRODUCT may be the 2nd most versatile function with IF being the most
versatile.

For everything you always wanted to know about SUMPRODUCT and didn't know
where to look:

http://xldynamic.com/source/xld.SUMPRODUCT.html

Biff

"LauriS" wrote in message
...
Biff,

THANKS!! That did the trick! I had never heard of the SUMPRODUCTS
function
- learned something new!

Lauri

"T. Valko" wrote:

Are the day of week headers TEXT strings?

If a person did not work on a particular day is that cell left empty?

Try this:

B1:AQ1 = day of week headers as TEXT strings: Monday, Tuesday, etc
B2:AQ2 = shift code if worked, otherwise empty

To count the number of Mondays worked:

=SUMPRODUCT(--(B1:AQ1="Monday"),--(B2:AQ2<""))

Biff




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
Counting Occurances across a range of sheets [email protected] Excel Discussion (Misc queries) 8 April 3rd 07 02:51 PM
Counting repeated occurances Kannan UGS Excel Worksheet Functions 2 March 13th 07 02:30 PM
Counting Occurances Rusty Excel Discussion (Misc queries) 5 July 10th 06 08:29 PM
counting occurances SR89 Excel Worksheet Functions 6 June 28th 06 01:46 AM
Counting Date Occurances JerryBS Excel Worksheet Functions 1 March 6th 05 07:29 PM


All times are GMT +1. The time now is 10:23 AM.

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"