summing mulitple lookup values, catchy

G

Guest

I have a table looking like thi
Fruit No. Tota
apple 1 (?
apple
apple
banana 1 (?
banana

I then want to use a function to add up all the apples, in this case 4, and stick the number 4 in the total column (see (?)), the same with bananas and so on. any ideas?
 
G

gulfjim

It sound like this is a perfect use for SUMIF.

--
Greetings from the Gulf Coast!
Nathan D said:
I have a table looking like this
Fruit No. Total
apple 1 (?)
apple 1
apple 2
banana 1 (?)
banana 3

I then want to use a function to add up all the apples, in this case 4,
and stick the number 4 in the total column (see (?)), the same with bananas
and so on. any ideas?
 
F

Frank Kabel

Hi Nathan
is your column A sorted by Fruits. If yes enter the following in C2
(the first data row for your total)
=IF($A2<>$A1,SUMIF($A2:$A$999,$A2,$B2:$B$999),"")
copy down

frank
 
B

Bill Ridgeway

This may not be the most elegant solution but it works -

Create a number of 'Total' columns
Column C: =IF(An="apple",Bn,"")
Column D: =IF(An="banana",Bn,"")
Column E: =IF(An="pear",Bn,"")

Total columns C through E and you have your answer.

This solutions has the benefit of being able to group items -
Column C:=IF(OR(An="apple", An="banana"),Bn,"")
Column D: =IF(An="pear",Bn,"")

Regards.

Bill Ridgeway
Computer Solutions
Nathan D said:
I have a table looking like this
Fruit No. Total
apple 1 (?)
apple 1
apple 2
banana 1 (?)
banana 3

I then want to use a function to add up all the apples, in this case 4,
and stick the number 4 in the total column (see (?)), the same with bananas
and so on. any ideas?
 

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