Sum of numbers in a matrix...

Z

Zadig Galbaras

Hi..
Hope this is the right newsgroup.

I have this spreadsheet.
In it there is a matrix with names and numbers.
Lets say.
A1=Anthony B1=3 C1=6
A2=Anthony B2=2
A3=Johnny B3=3
A4=Anthony B4=1

How do I come about to sum up all of Anthony's numbers in column B in let's
say cell C1?
It should display the number 6 which is the total of Anthony's numbers.
Vlookup doesn't do it. It only shows the number of the first encounter og
the name Anthony, namely the number 3.


Regards
Zadig Galbaras
 
P

Peo Sjoblom

=SUMIF(A:A,"Anthony",B:B)

or

=SUMIF(A:A,D1,B:B)

where D1 would contain Anthony, the latter is abviously more flexible since
it allow you to change criteria without editing the formula
 
S

SteveG

You could also use

=SUMPRODUCT(--(A1:A4="Anthony"),(B1:B4))

or

=SUMPRODUCT(--(A1:A4=D1),(B1:B4))

where D1 contains Anthony.

Cheers,

Steve
 
Z

Zadig Galbaras

Very nie!
Thank you very much to both of you, Peo & Steve.
Works fine! Solved my problem, and another emerged :)
what if....
A B C D E F G H I
1 Anthony 3 2 34 5 6 7 7
2 Anthony 2 2 3 2 4 5 7
3 Johnny 3 4 7 8 9 9 0 0
4 Anthony 1 4 2 6 7 8


Is there a way to pick out let's say all of Anthony's numbers in column E
and add them up in a cell?
The sum should be 34+3+2 = 39
 
Z

Zadig Galbaras

ehamm...
I probably was to fast for my own brain there....
All I have to do is change the last parameter in the funcion from B1:B4 to
D1:D4

Well I only human...No Intel inside..
hehe...


--

Regards
Zadig Galbaras
A Perturbed Norwegian Agnostic

--
 
Z

Zadig Galbaras

No, that didn't work...
I changed the B1:B4 to D1:D4 in both formulas, but the result was a 0.
 
D

Dave Peterson

This didn't work?

=SUMIF(A:A,"Anthony",E:E)



Zadig said:
Very nie!
Thank you very much to both of you, Peo & Steve.
Works fine! Solved my problem, and another emerged :)
what if....
A B C D E F G H I
1 Anthony 3 2 34 5 6 7 7
2 Anthony 2 2 3 2 4 5 7
3 Johnny 3 4 7 8 9 9 0 0
4 Anthony 1 4 2 6 7 8

Is there a way to pick out let's say all of Anthony's numbers in column E
and add them up in a cell?
The sum should be 34+3+2 = 39

--

Regards
Zadig Galbaras
A Perturbed Norwegian Agnostic
 
Z

Zadig Galbaras

Sorry...it did...I'm just too fast for my brain.
Your formula solved a big problem for me.
Now I could now use one spreadsheet to do what I needed a spreadsheet for
each employee in the past.
This was really great.
Again thank you..

--

Regards
Zadig Galbaras
A Perturbed Norwegian Agnostic

--
 

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