Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Sumproduct with weekend day test

A2:A32 contains dates (in proper date-number format), and may contain up to 3
blanks (from A30:A32) depending on the length of the month in question.
C2:C32 contains names and will have the same number of blanks as the date
range.
A39 contains "H"
I need to find the number of occurrences where "H" is in the C column and
the date on the same line in the A column represents a weekend day.

I started to build the formula using only Saturday as a test but
=SUMPRODUCT(--(C2:C32=A39),(WEEKDAY(A2:A32,2)=6)) retuned a zero when there
was an "H" in the same row as Nov 15, 2008 (Saturday). The first array works
fine by itself, but I clearly don't understand how to set up the second aray.

Please show me the correct way, especially to include both Satudays and
Sundays in the result.

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Sumproduct with weekend day test

Try this:

=SUMPRODUCT(--(WEEKDAY(A2:A32,2)5),--(C2:C32=A39))


--
Biff
Microsoft Excel MVP


"Loge" wrote in message
...
A2:A32 contains dates (in proper date-number format), and may contain up
to 3
blanks (from A30:A32) depending on the length of the month in question.
C2:C32 contains names and will have the same number of blanks as the date
range.
A39 contains "H"
I need to find the number of occurrences where "H" is in the C column and
the date on the same line in the A column represents a weekend day.

I started to build the formula using only Saturday as a test but
=SUMPRODUCT(--(C2:C32=A39),(WEEKDAY(A2:A32,2)=6)) retuned a zero when
there
was an "H" in the same row as Nov 15, 2008 (Saturday). The first array
works
fine by itself, but I clearly don't understand how to set up the second
aray.

Please show me the correct way, especially to include both Satudays and
Sundays in the result.

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Sumproduct with weekend day test

Perfect - Thanks!

I don't understand the double unary. What, exactly, is the math behind it?
Do you have a good reference on the double unary or the SUMPRODUCT function?



"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(WEEKDAY(A2:A32,2)5),--(C2:C32=A39))


--
Biff
Microsoft Excel MVP


"Loge" wrote in message
...
A2:A32 contains dates (in proper date-number format), and may contain up
to 3
blanks (from A30:A32) depending on the length of the month in question.
C2:C32 contains names and will have the same number of blanks as the date
range.
A39 contains "H"
I need to find the number of occurrences where "H" is in the C column and
the date on the same line in the A column represents a weekend day.

I started to build the formula using only Saturday as a test but
=SUMPRODUCT(--(C2:C32=A39),(WEEKDAY(A2:A32,2)=6)) retuned a zero when
there
was an "H" in the same row as Nov 15, 2008 (Saturday). The first array
works
fine by itself, but I clearly don't understand how to set up the second
aray.

Please show me the correct way, especially to include both Satudays and
Sundays in the result.

Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Sumproduct with weekend day test

See this:

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

--
Biff
Microsoft Excel MVP


"Loge" wrote in message
...
Perfect - Thanks!

I don't understand the double unary. What, exactly, is the math behind
it?
Do you have a good reference on the double unary or the SUMPRODUCT
function?



"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(WEEKDAY(A2:A32,2)5),--(C2:C32=A39))


--
Biff
Microsoft Excel MVP


"Loge" wrote in message
...
A2:A32 contains dates (in proper date-number format), and may contain
up
to 3
blanks (from A30:A32) depending on the length of the month in question.
C2:C32 contains names and will have the same number of blanks as the
date
range.
A39 contains "H"
I need to find the number of occurrences where "H" is in the C column
and
the date on the same line in the A column represents a weekend day.

I started to build the formula using only Saturday as a test but
=SUMPRODUCT(--(C2:C32=A39),(WEEKDAY(A2:A32,2)=6)) retuned a zero when
there
was an "H" in the same row as Nov 15, 2008 (Saturday). The first array
works
fine by itself, but I clearly don't understand how to set up the second
aray.

Please show me the correct way, especially to include both Satudays and
Sundays in the result.

Thanks!






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,073
Default Sumproduct with weekend day test

On Dec 10, 12:40*pm, Loge wrote:
A2:A32 contains dates (in proper date-number format), and may contain up to 3
blanks (from A30:A32) depending on the length of the month in question.
C2:C32 contains names and will have the same number of blanks as the date
range.
A39 contains "H"
I need to find the number of occurrences where "H" is in the C column and
the date on the same line in the A column represents a weekend day.

I started to build the formula using only Saturday as a test but
=SUMPRODUCT(--(C2:C32=A39),(WEEKDAY(A2:A32,2)=6)) retuned a zero when there
was an "H" in the same row as Nov 15, 2008 (Saturday). *The first array works
fine by itself, but I clearly don't understand how to set up the second aray.

Please show me the correct way, especially to include both Satudays and
Sundays in the result.

Thanks!


=SUMPRODUCT((C2:C32=A39)*(WEEKDAY(A2:A32,2)5))

or include the double unary for the 2nd argument...

=SUMPRODUCT(--(C2:C32=A39),--(WEEKDAY(A2:A32,2)5))

Ken Johnson


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
Weekend Dates Tracey Charts and Charting in Excel 1 August 13th 08 11:03 AM
Weekend The Rook[_2_] Excel Discussion (Misc queries) 12 June 11th 08 06:11 PM
SumProduct but sometimes don't test some criteria Aaron Excel Worksheet Functions 20 March 2nd 08 08:42 PM
Weekend Pass Codes Excel Worksheet Functions 2 June 4th 07 09:02 PM
Calculate mean of test scores from rows of test answers RiotLoadTime Excel Discussion (Misc queries) 1 July 26th 06 05:14 PM


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