How sum values in column B using values in column A as the conditi

O

oldgrayelf

I want to sum the values in column B using indicators in column A as the
condition. For instance, all values in column B matching the "1" indicator
in column A should be summed, and no others. Other indicators in column A
are 2, 3, etc. I know this takes an array formula, but I don't remember how
to do it.
 
M

Mac

OGE:

If you are testing for a single condition in Column A, you can use the
SUMIF() function. The online help provides full documentation.
Alternatively, begin the formula, "=sumif(" and then press CTRL-A. Follow
the prompts.

=Mac=
 
J

JulieD

Hi

no need for an array formula you can use the SUMIF function
=SUMIF(A1:A10,1,B1:B10)
or with the 1 in C1, in D1
=SUMIF($A$1:$A$10,C1,$B$1:$B$10)
this can then be filled down the other 'indicators'

Cheers
JulieD
 
O

oldgrayelf

SUMIF will add the ENTIRE "B" column if there is ANY "1" in column "A". I
only want the values in column "B" added that match the "1" identifier in
column "A". I did remember how to do it. Use this array formula (enter it
using Crtl-Shift-Enter after entering the formula into the cell you want the
answer to be found): "{=SUM(IF(A1:A10="1",B1:B10))}" Do not type in the
curly brackets. Excel adds them when you enter the formula using the
Crtl-Shift-Enter combination to identify it as an array formula and not a
regular formula. If you just enter the formula using the Enter key, you will
get an error. If there is another identifier, say "2", in column "A" and you
want those values that match it in column "B" added, the array formula looks
like this: {=SUM(IF(A1:A10="2",B1:B10))} - and so on.
 
P

Peo Sjoblom

No, sumif will NOT add the entire range, only those that has the 1 criteria
in A
although the array formula works it's a waste of resources compared to SUMIF
which is faster
and simpler


Regards,

Peo Sjoblom
 
O

oldgrayelf

You are correct. I was wrong - and also entering the SUMIF function
incorrectly. Thank You!
 

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