Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sum

1 view
Skip to first unread message

Rod

unread,
Jan 4, 2010, 10:32:01 AM1/4/10
to
Hi, I have data as shown below.
Col-A Col-B Col-C Col-D
a 10 b
b 15 d
c 20
d 25
e 30
I need the sum of "b" and "d" values(15+25) in column D1(40). If I add the
any letter of Col-A in column c it will automatically update the value in D1.
Could any one help me please. Thanks in advance.

Bernard Liengme

unread,
Jan 4, 2010, 10:51:49 AM1/4/10
to
=SUMIF(A:A,C1,B:B)
assuming cell C1 holds the value b
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Rod" <R...@discussions.microsoft.com> wrote in message
news:D68E252D-EF7E-439E...@microsoft.com...

Eduardo

unread,
Jan 4, 2010, 10:57:01 AM1/4/10
to
Hi,
in D1 enter
=sumproduct(--(C1=$a$1:$A$1000),$B$1:$B$1000)

change range to fit your needs

Max

unread,
Jan 4, 2010, 11:08:01 AM1/4/10
to
In D1: =SUMPRODUCT(--(ISNUMBER(MATCH(A1:A10,C1:C2,0))),B1:B10)
where C1:C2 houses the elements, eg: b, d (as you posted)
Success? hit the YES below
--
Max
Singapore
---

Rod

unread,
Jan 4, 2010, 11:17:01 AM1/4/10
to
Thanks for quick response, when I enter this formula in D1 i am getting just
15 only

Rod

unread,
Jan 4, 2010, 12:01:01 PM1/4/10
to
Thank you so much

If you don't mind could you please explain briefly the logic behind it?

Thanks in advance.

Max

unread,
Jan 4, 2010, 6:11:38 PM1/4/10
to
MATCH(A1:A10,C1:C2,0)
exact matches every element in A1:A10 with that in C1:C2
and returns a resulting col array like this:
{#N/A;1;#N/A;2;#N/A;#N/A;#N/A;#N/A;#N/A;#N/A}
where #N/A = no match,
numbers 1, 2 = the relative positions where the match is found

ISNUMBER(MATCH(A1:A10,C1:C2,0))
then converts it to True/False:
{FALSE;TRUE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE}
where #N/A = False, any number (ie the 1, 2) = True

The double minus: --
--(ISNUMBER(MATCH(...)))
then converts the True/Falses to 1/0:
{0;1;0;1;0;0;0;0;0;0}

The sumproduct then cross-multiplies the above final array of 1/0s with the
corresponding numbers in B1:B10 and sums the lot, giving the desired result
--
Max
Singapore


"Rod" <R...@discussions.microsoft.com> wrote in message

news:FD29FCF2-CF0F-4750...@microsoft.com...

Rod

unread,
Jan 5, 2010, 10:07:01 AM1/5/10
to
Thanks a lot

"Max" wrote:

> .
>

mpima

unread,
Jan 7, 2010, 6:12:01 PM1/7/10
to
How do I sum a row of cells w/ numbers and letters (various) in each cell?
--
mpima

Gary''s Student

unread,
Jan 7, 2010, 6:32:01 PM1/7/10
to
Use =SUM()

for example if A1 thru F1 contains:

1 2 3 qwerty 5 67

then SUM(A1:F1) returns 78
qwerty is treated like a zero.
--
Gary''s Student - gsnu200909

0 new messages