Summing conditional columns

P

Paul

Basically, I am trying to create a formula that would sum the numbers in one
column should the next column have a specific date. For example, i would
like to sum all numbers in column X if a row in column A has "Sept" or "Nov".
here is my formula so far. what this will obviously do is SUM the column
C2:C14 if ANY row in column E is labeled "Sept". i hope i making this as
clear as possible.

=IF(E2:E14="Sept", SUM(C2:C14),0)

the 0 in the end of the formula is just temporary, i was having the formula
place a 0 if the formula didn't find "Sept" in column E.

thanks for any help or tips!

Paul
 
C

Chip Pearson

There are a variety of ways to do this. One is with an array formula:

=SUM(IF(E2:E14="Sept",C2:C14,0))

Since this is an Array Formula, you *must* press CTRL SHIFT ENTER
rather than just ENTER when you first enter the formula
and whenever you edit it later. If you do this properly,
Excel will display the formula in the Formula Bar enclosed
in curly braces { }. (You do not type the curly braces -
Excel includes them automatically.) The formula will
not work properly if you do not use CTRL SHIFT ENTER. See
http://www.cpearson.com/excel/ArrayFormulas.aspx for lots
more information about array formulas.

Another method is SUMPRODUCT

=SUMPRODUCT(--(E2:E14="Sept"),C2:C14)


Yet another way is with SUMIF

=SUMIF(C2:C14,"Sept",E2:E14)

There are many variations on these themes.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

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