#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Sumif weekday

I'm trying to sumif different days of the week. Table is setup as below:

A. Date Date Date Date Date ......
B. Data Data Data Data Data ......

I know that =weekday(Date,1) will give me a 1 through 7 of the date Sunday
through Saturday. Somehow, I feel like =sumif(A:A,weekday(A:A)=1,sum(B:B))
would give me the sum of all Sundays but it's not quite working.

What am I'm doing wrong? Can someone help me out? I don't want to make row A
into a static Sun, Mon, Tue. Then it's easy since =sumif(A:A,="Sun",sum(B:B))
would probably work.

Thanks so much for all the help in advance.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Sumif weekday

=SUMPRODUCT(--(WEEKDAY(A2:A40)=1),B2:B40)

Adjust your range to suit, you can not use whole column pior to XL-2007



"Sungibungi" wrote:

I'm trying to sumif different days of the week. Table is setup as below:

A. Date Date Date Date Date ......
B. Data Data Data Data Data ......

I know that =weekday(Date,1) will give me a 1 through 7 of the date Sunday
through Saturday. Somehow, I feel like =sumif(A:A,weekday(A:A)=1,sum(B:B))
would give me the sum of all Sundays but it's not quite working.

What am I'm doing wrong? Can someone help me out? I don't want to make row A
into a static Sun, Mon, Tue. Then it's easy since =sumif(A:A,="Sun",sum(B:B))
would probably work.

Thanks so much for all the help in advance.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Sumif weekday

On Tue, 6 Apr 2010 20:19:01 -0700, Teethless mama
wrote:

=SUMPRODUCT(--(WEEKDAY(A2:A40)=1),B2:B40)

Adjust your range to suit, you can not use whole column pior to XL-2007



If you are using the 1900 date system, and DOW=7, you will also add any values
in B2:B40 where A2:A4 is blank.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Sumif weekday

On Tue, 6 Apr 2010 19:29:01 -0700, Sungibungi
wrote:

I'm trying to sumif different days of the week. Table is setup as below:

A. Date Date Date Date Date ......
B. Data Data Data Data Data ......

I know that =weekday(Date,1) will give me a 1 through 7 of the date Sunday
through Saturday. Somehow, I feel like =sumif(A:A,weekday(A:A)=1,sum(B:B))
would give me the sum of all Sundays but it's not quite working.

What am I'm doing wrong? Can someone help me out? I don't want to make row A
into a static Sun, Mon, Tue. Then it's easy since =sumif(A:A,="Sun",sum(B:B))
would probably work.

Thanks so much for all the help in advance.


If DOW = Day of the Week (Sun=1, Mon=2, ...), and you are using Excel 2007 or
later:

=SUMPRODUCT((WEEKDAY(A:A)=DOW)*ISNUMBER(A:A),B:B)

If using a version of Excel prior to 2007, then you cannot refer to an entire
column. So the maximum range would be:

=SUMPRODUCT((WEEKDAY(A1:A65535)=DOW)*ISNUMBER(A1:A 65535),B1:B65535)

However, it would be best to either make the range dynamic, or have it small
enough to always encompass the maximum number of entries.

--ron
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
Weekday and Sumif Mike Excel Discussion (Misc queries) 3 December 23rd 07 09:01 AM
WEEKDAY() function: display TEXT not numeric weekday tom Excel Discussion (Misc queries) 3 November 21st 06 04:32 PM
WEEKDAY() Epinn New Users to Excel 29 September 10th 06 11:39 AM
Weekday LB79 Excel Worksheet Functions 2 July 28th 06 02:59 PM
Weekday Thomas Excel Worksheet Functions 6 January 29th 06 01:07 AM


All times are GMT +1. The time now is 10:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"