how the solution

E

Evan Ip

What function can i do to make this condition.
A B C D
|code|weight| |code|totalWeight|
1 50 1 150
1 60 2 80
1 40 ...........
2 20
2 60
.....

Please help me
Thanks, all
 
P

Peo Sjoblom

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

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

where A is the code and B the weight

it might be better to use a cell to put the criteria in like

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

where you would put the code in C1

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey
 
B

Biff

Hi!

Try this:

C2 = 1
C3 = 2

Enter this formula in D2:

=SUMIF(A$2:A$6,C2,B$2:B$6)

Copy down as needed.

Biff
 
Top