If cell contains a certain text, add the numbers of another cell [Solved]

Ask a question mmbitar 2Posts Saturday February 4, 2017Registration date February 5, 2017 Last seen - Last answered on Feb 6, 2017 at 06:52 AM by Mazzaropi
Hello, I am trying to do my finances in an easier way, and would appreciate it if anyone can help me with the below question:

B2=Supermarket , C2=30$
B3=Fuel, C3=20$
B4=Fuel, C4=50$

if Bs="Fuel", i want to add the numbers in the adjacents cells together. but only if they contain the text in the B cells.
how can that be done without having to name each cell in case the list is long:
=IF(H6="Fuel", I6, 0)+IF(H7="Fuel", I7, 0)+IF(H8="Fuel", I8, 0)+IF(H9="Fuel", I9, 0)+IF(H10="Fuel", I10, 0)+IF(H11="Fuel", I11, 0) ...

Thank you all in advance!
See more 
moins plus
mmbitar, Good morning.

Try to use:

=SUMIF(H6:H20, "Fuel", I6:I20)

Adapt range references to your reality.

Is that what you want?
I hope it helps.
Belo Horizonte, Brasil.
Marcílio Lobão
Leave a comment

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.

Not a member yet?

Sign up now. It takes less than a minute and is completely free!