View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
nukegirl nukegirl is offline
external usenet poster
 
Posts: 2
Default Sum of named ranges conditional to date?

I tried this formula and I can not seem to make it work. Is the MAX IF
formula supposed to generate a zero as a result?



"Aladin Akyurek" wrote:

D2: 3/1/05
E2: 3/31/05
F2:

=MAX(IF(($A$1:$A$4=D2)*($A$1:$A$4<=E2),$A$1:$A$4) )

which must be confirmed with control+shift+enter instead of just with enter.

G2:

=SUMIF($A$1:$A$4,F2,$B$1:$B$4)

SleazyBreezy wrote:
Okay, now I have a second, similar problem. Here's my new table:

A1: 03/01/2005
B1: $5.00
A2: 03/05/2005
B2: $12.00
A3: 04/05/2005
B3: $3.00
A4: 03/05/2005
B4: $50.00

As before, the A column is named Base_Date and the B column is named
Base_Amount. I want to modify the SUMIF formula, as used below, so that it
adds only the records associated with the *latest* date in a specified date
range. Referencing the table above, if I specify 03/01/2005 and
<=03/31/2005, the formula should add B2+B4, and not include B1. However, if I
then add the following to the table:

A5: 03/29/2005
B5: $1.00

The formula should only report back B5 for its value, as A5 is the latest
date in the allowed range.

Thanks again in advance.

:-)

- Sleazy

"SleazyBreezy" wrote:


Thank you very much! Thankfully, my date criteria is static, so the X2/Y2
variables are not needed. I used your formula to achieve the desired result
by moving the closing quotes as follows:

=SUMIF(Base_Date,"=03/01/2005",Base_Amount)-SUMIF(Base_Date,"03/31/2005",Base_Amount)