#1   Report Post  
Jonathan Cooper
 
Posts: n/a
Default array formula

Can't figure out why this formula isn't working. Column A1:A30 contain
dates, starting with 9/1/05 and incrementing by one day. Column B1:B30
contain numbers. I want to look at column A, and if it's a Monday, then I
want to sum the values in column B.

={SUMPRODUCT((WEEKDAY(A1:A30,2)=1*($B$1:$B$30)))}

My only guess is that you can't use the WEEKDAY function as an array.
However, when I look at that part of the formula in the formula editor, it
looks like it is working.
  #2   Report Post  
Eric
 
Posts: n/a
Default

Jonathan,

I think you just mixed up your brackets. Try:
=SUMPRODUCT((WEEKDAY(A1:A30,2)=1)*($B$1:$B$30))

This seems to work for me. By the way, you don't need to enter SUMPRODUCT
as an array formula.

Another approach to this would be to use a helper column. Insert a new
column for column B. Set B1=WEEKDAY(A1) and copy down. Then you can use
=SUMIF(A1:A30,2,C1:C30)

Eric

"Jonathan Cooper" wrote:

Can't figure out why this formula isn't working. Column A1:A30 contain
dates, starting with 9/1/05 and incrementing by one day. Column B1:B30
contain numbers. I want to look at column A, and if it's a Monday, then I
want to sum the values in column B.

={SUMPRODUCT((WEEKDAY(A1:A30,2)=1*($B$1:$B$30)))}

My only guess is that you can't use the WEEKDAY function as an array.
However, when I look at that part of the formula in the formula editor, it
looks like it is working.

  #3   Report Post  
Jonathan Cooper
 
Posts: n/a
Default

Thanks. I knew is was something stupid, but it just wasn't jumping out at me.

"Eric" wrote:

Jonathan,

I think you just mixed up your brackets. Try:
=SUMPRODUCT((WEEKDAY(A1:A30,2)=1)*($B$1:$B$30))

This seems to work for me. By the way, you don't need to enter SUMPRODUCT
as an array formula.

Another approach to this would be to use a helper column. Insert a new
column for column B. Set B1=WEEKDAY(A1) and copy down. Then you can use
=SUMIF(A1:A30,2,C1:C30)

Eric

"Jonathan Cooper" wrote:

Can't figure out why this formula isn't working. Column A1:A30 contain
dates, starting with 9/1/05 and incrementing by one day. Column B1:B30
contain numbers. I want to look at column A, and if it's a Monday, then I
want to sum the values in column B.

={SUMPRODUCT((WEEKDAY(A1:A30,2)=1*($B$1:$B$30)))}

My only guess is that you can't use the WEEKDAY function as an array.
However, when I look at that part of the formula in the formula editor, it
looks like it is working.

  #4   Report Post  
Morrigan
 
Posts: n/a
Default


=SUMPRODUCT(--(WEEKDAY(A1:A30,2)=1),B1:B30)

Jonathan Cooper Wrote:
Can't figure out why this formula isn't working. Column A1:A30 contain
dates, starting with 9/1/05 and incrementing by one day. Column
B1:B30
contain numbers. I want to look at column A, and if it's a Monday,
then I
want to sum the values in column B.

={SUMPRODUCT((WEEKDAY(A1:A30,2)=1*($B$1:$B$30)))}

My only guess is that you can't use the WEEKDAY function as an array.
However, when I look at that part of the formula in the formula editor,
it
looks like it is working.



--
Morrigan
------------------------------------------------------------------------
Morrigan's Profile: http://www.excelforum.com/member.php...fo&userid=7094
View this thread: http://www.excelforum.com/showthread...hreadid=465922

  #5   Report Post  
Jim May
 
Posts: n/a
Default

=SUMPRODUCT(--(WEEKDAY(A1:A30,1)=2),B1:B30)


worked for me;
HTH
"Morrigan" wrote in
message ...

=SUMPRODUCT(--(WEEKDAY(A1:A30,2)=1),B1:B30)

Jonathan Cooper Wrote:
Can't figure out why this formula isn't working. Column A1:A30 contain
dates, starting with 9/1/05 and incrementing by one day. Column
B1:B30
contain numbers. I want to look at column A, and if it's a Monday,
then I
want to sum the values in column B.

={SUMPRODUCT((WEEKDAY(A1:A30,2)=1*($B$1:$B$30)))}

My only guess is that you can't use the WEEKDAY function as an array.
However, when I look at that part of the formula in the formula editor,
it
looks like it is working.



--
Morrigan
------------------------------------------------------------------------
Morrigan's Profile:
http://www.excelforum.com/member.php...fo&userid=7094
View this thread: http://www.excelforum.com/showthread...hreadid=465922



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
problem with Array Formula OrdOff Excel Worksheet Functions 2 June 30th 05 04:57 PM
How can you use count with an array formula similar to using sum PhilH Excel Worksheet Functions 3 June 27th 05 08:00 AM
Trouble shooting#NA error in Array formula RonR Excel Discussion (Misc queries) 2 June 14th 05 09:58 PM
Changing a range of an array in a SUMPRODUCT formula gives a #N/A error Chrism Excel Discussion (Misc queries) 4 May 4th 05 04:06 PM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM


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