Need help in calculation at specific location

L

Lewis Koh

A B C
1 breakfast $13.50
2 water $1.10
3 food $80.00
4 others $13.90
5 food $4

Is it possible to type an equation whereby it will scan A1:C5 and i
the word "food" is found it will add the number next to it? I can'
seems to use IF(logic_test, true value,false value) for this... pl
hel
 
B

Bob Phillips

=sumif(A:A,"food",B:B)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
L

Lewis Koh

Thanks guys!!!! It works!!! BTW, how did you guys learn to use thes
syntax? I can't seems to find the syntax to use from the Exce
Help...Don't even know where to start.
 
L

Lewis Koh

Lewis said:
A B C D E
1 breakfast $13.50 food $5
2 water $1.10 Shirt $10
3 food $80.00
4 others $13.90
5 food $4

Is it possible to type an equation whereby it will scan A1:C5 and if
the word "food" is found it will add the number next to it? I can't
seems to use IF(logic_test, true value,false value) for this... pls
help

Hmm...=sumif(B1:B5,"Food",C1:C5) can't work if food appears on another
column. Is there a way to work around this?
 
B

Bob Phillips

You have to add a separate summation for that column.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
L

Lewis Koh

Lewis said:
A B C
1 Breakfast $13.50
2 water $1.10
3 Lunch $80.00
4 others $13.90
5 Dinner $4

Hmm...now I wanted to catogorized breakfast,lunch and dinner as food. I
tried B6=SUMIF(B1:B5,OR("breakfast","Lunch","Dinner"),C1:C5). The logic
seems to be allowable but it couldn't add up to the correct amount. It
always shows "0". May I know if I have typed something wrong?
 
M

Max

Try instead, array-entered (i.e. press CTRL+SHIFT+ENTER):

=SUM(IF(A1:A5={"Breakfast","Lunch","Dinner"},B1:B5))
 
D

Domenic

Try.

=SUMPRODUCT(--(ISNUMBER(MATCH(B1:B5,{"Breakfast","Lunch","Dinner"},0))),C1:C5)

OR

=SUMPRODUCT(--(ISNUMBER(MATCH(B1:B5,E1:E3,0))),C1:C5)

...wherre E1:E3 contains Breakfast, Lunch, and Dinner.

Hope this helps!
 
B

Bob Phillips

=SUM(SUMIF(B1:B5,{"Breakfast","Lunch","Dinner"},C1:C5))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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