# Thread: Formula for excel 2010 to compare dates in cells and return sum

1. ## Formula for excel 2010 to compare dates in cells and return sum

Hello-I am trying to develop a formula where I would take the dates in a column range and compare it to a date on a particular cell. If the return value is true, I would then want it to sum the numbers in a different column. See sample below.

column A Column B Column C Column E
cards 1 3/14/2014 2/1/2014
ink 0.5 2/28/2014
envelops 1 2/28/2014
staples 2 1/31/2014
toner 0.75 1/1/2014

I want it to give me the sum of column B where the date is greater than or equal to column e. Thank you.

Code:
`=SUMPRODUCT((C2:C6>=E2:E6)*B2:B6)`
or if you don't want to sum the blanks in col E:
Code:
`=SUMPRODUCT((C2:C6>=E2:E6)*B2:B6*(E2:E6<>""))`
Steve

3. Seba,

Another option:
Seba.JPG
HTH

4. RG,
Yours may be the correct solution. My solution assumes a separate date in each row in E to compare to the value in C. With only 1 date in the example, perhaps they were all supposed to be compared to E2.

If that is the logic another solution is
=SUMIF(C2:C6,">="&E2,B2:B6)

so that E2 can remain a date instead of having to enter the text string

Steve

5. Thank you all for your help. Sdckapr formula computed what I needed. One more question, if I want to have the formula give me everything that felt 30 days after the date specify in E2, how would I do that?