array formula

G

Guest

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.
 
G

Guest

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
 
M

Morrigan

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

Jonathan said:
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. Colum
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top