date formula

D

Dreamstar_1961

what I'm trying to do is, I have three columns which are labeled as below

k l m
Date Compl Amt Adj level
20/03/07 $300 test
22/3/06 $600 test
26/3/07 $200 test
27/3/07 $500 other
28/3/07 $400 test

what I need is a formula that would add only those from test in the current
week which in the example would return $600, any ideas on how tto do this?
 
T

T. Valko

Try this:

=SUMPRODUCT(--(A2:A6>=TODAY()-WEEKDAY(TODAY(),3)),--(A2:A6<=TODAY()-WEEKDAY(TODAY(),3)+6),--(C2:C6="test"),B2:B6)

Or, you can put this formula in another cell to calculate the start of the
current week: (I'm assuming the week is Mon to Sun)

D2: =TODAY()-WEEKDAY(TODAY(),3)

Then:

=SUMPRODUCT(--(A2:A6>=D2),--(A2:A6<=D2+6),--(C2:C6="test"),B2:B6)

Biff
 
D

Dreamstar_1961

that worked but I now have found part of it that needs an array, but it is
not excepting the formula, I keep getting the #value error, this is what I
put in
=SUMPRODUCT(--(A2:A6>=TODAY()-WEEKDAY(TODAY(),3)),--(A2:A6<=TODAY()-WEEKDAY(TODAY(),3)+6),--(C2:C6={"other","test"}),B2:B6)
any idea what is wrong.
thanks
 
T

T. Valko

Try it like this:

=SUMPRODUCT((A2:A6>=TODAY()-WEEKDAY(TODAY(),3))*(A2:A6<=TODAY()-WEEKDAY(TODAY(),3)+6)*(C2:C6={"other","test"})*B2:B6)

Biff
 
D

Dreamstar_1961

worked like a charm,

thank you


T. Valko said:
Try it like this:

=SUMPRODUCT((A2:A6>=TODAY()-WEEKDAY(TODAY(),3))*(A2:A6<=TODAY()-WEEKDAY(TODAY(),3)+6)*(C2:C6={"other","test"})*B2:B6)

Biff
 

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