ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Calculate totals (https://www.excelbanter.com/excel-discussion-misc-queries/117550-calculate-totals.html)

Mike Mike

Calculate totals
 
This is what I got:
bananas 5 9 3 1
bananas 1 2 7 3
bananas 8 7 4 2
oranges 1 5 1 3
oranges 2 4 8 2
pears 9 5 2 3
pears 7 5 2 3 etc......

I need one row with the totals for each "fruit"

bananas 14 18 14 6
oranges 3 9 9 5
pears 16 10 4 6 etc...

Anyone know how to do this?



Paul B

Calculate totals
 
Mike, use something like this,

=SUMIF(A1:A10,"bananas",B1:B10)

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Mike Mike" wrote in message
...
This is what I got:
bananas 5 9 3 1
bananas 1 2 7 3
bananas 8 7 4 2
oranges 1 5 1 3
oranges 2 4 8 2
pears 9 5 2 3
pears 7 5 2 3 etc......

I need one row with the totals for each "fruit"

bananas 14 18 14 6
oranges 3 9 9 5
pears 16 10 4 6 etc...

Anyone know how to do this?





Dallman Ross

Calculate totals
 
In , Mike Mike
spake thusly:

This is what I got:
bananas 5 9 3 1
bananas 1 2 7 3
bananas 8 7 4 2
oranges 1 5 1 3
oranges 2 4 8 2
pears 9 5 2 3
pears 7 5 2 3 etc......

I need one row with the totals for each "fruit"

bananas 14 18 14 6
oranges 3 9 9 5
pears 16 10 4 6 etc...


Assuming you're starting in Col A with the names
and data begins on the first row, then -- in
B14, where you have the first "bananas" total,
use this:

=SUMIF($A1:$A7,OFFSET($A$1,ROW()-1,0),B1:B7)

Drag that down and across. This also assumes you
are repeating the names in Col. A on your totals
rows, as you have done in the example.

-dman-

Bernard Liengme

Calculate totals
 
Read Help to fins out about SUMIF then come back with any questions
OR learn about pivot tables (a bit more complicated)
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Mike Mike" wrote in message
...
This is what I got:
bananas 5 9 3 1
bananas 1 2 7 3
bananas 8 7 4 2
oranges 1 5 1 3
oranges 2 4 8 2
pears 9 5 2 3
pears 7 5 2 3 etc......

I need one row with the totals for each "fruit"

bananas 14 18 14 6
oranges 3 9 9 5
pears 16 10 4 6 etc...

Anyone know how to do this?





Dallman Ross

Calculate totals
 
In , Dallman Ross <dman@localhost.
spake thusly:

Assuming you're starting in Col A with the names
and data begins on the first row, then -- in
B14, where you have the first "bananas" total,
use this:


I didn't mean "B14", but rather in the first totals
row (for "bananas") in Col B. When I set up my
test sheet, I had it in B14, but it doesn't matter
which row the totals start on:

=SUMIF($A1:$A7,OFFSET($A$1,ROW()-1,0),B1:B7)

Drag that down and across. This also assumes you
are repeating the names in Col. A on your totals
rows, as you have done in the example.


-dman-


All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com