repost: conditional sum?

L

Lamb Chop

I made a mistake and have already cancel the first mail, and I hope this
repost won't annoy people around here. If I did, I am sorry sorry.

Anyway, here is my question:

A1= Apple B1 =12
A2= Orange B2 = 52
A3 = Orange B3= 51
A4=Banana B4=53
A5 =grape B5=43
A6=grape B6 = 6
A7=grape B7 = 88



In the C column I'd like to add the number from B column if A column the
same.

The end result will look like:

C1= 12
C2 = 52+ 51 (as A2 and A3 both are orange so add B2 and B3
together)
C3= "" (leave it blank as C2 already did the job)
C4=53
C5 = 43+6 +88 (as A5, A6 and A7 are all grape, so add B5 to B7
together)
C6 = ""
C7 =""


so the outcome will look like this:

A1= Apple B1 =12 C1=12
A2= Orange B2 = 52 C2=103
A3 = Orange B3= 51 C3=
A4=Banana B4=53 C4=53
A5 =grape B5=43 C5=137
A6=grape B6 = 6 C6=
A7=grape B7 = 88 C7=


Any suggesion?

Thanks
 
M

Max

You've got 2 responses already to your earlier posting,
both of which should deliver what you want.

---
 
L

Lamb Chop

Sorry, Max, I made a mistake and thought the first one had not delivered, so
I tried to cancel the first one. I didn't know the first one was not
cancelled. I apologize for messing up the broad.

Thanks again to your answer, Max.

Lamb Chop
 
Y

Yipeeee

Don't bother using formula.

You can do this using the subtotal function.
In the Excel Menu, use Data, then Sub-total
(Make sure your list is sorted on the Fruit column.)

Or, and this is a million times more interesting, ...
Get your head into Pivot tables.

Pivot tables can do what you're trying to do.
They are the real XL number crunchers.

Yipeeeeeeeee
 
Y

Yipeeee

Using subtotal

Fruit Qte
Apple 12
Total Apple 12
Banana 53
Total Banana 53
grape 43
grape 88
Total grape 131
grape 6
Total grape 6
Orange 52
Orange 51
Total Orange 103
Total 305



Using Pivot Table
Sum of Qte
Fruit Total
Apple 12
Banana 53
grape 131
grape 6
Orange 103
Total 305



Yipeee
 
M

Max

No prob. You're welcome.

You can't cancel or withdraw a post once you send it off.
Just do a reply to it (your own posting) to clarify matters if necessary.
 

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