Sumif

G

Guest

How can I add numbers in a row that contain a specific letter? For example,
How can I add 3H to 4H. I just want it to add the numbers containing the
letter H.

Thanks
 
D

Dave Peterson

Contains means ends with????

=SUM(IF(RIGHT(A1:A3,1)="h",--LEFT(A1:A3,LEN(A1:A3)-1)))
or maybe:
=SUM(IF(RIGHT(A1:A3,1)="h",--LEFT(A1:A3,LEN(A1:A3)-1)))&"H"

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.
 
C

Carim

Hi JP,

If your data is located in range A1:A12 :

=SUMPRODUCT(LEFT(A1:A12,1)*(RIGHT(A1:A12,1)="H"))

HTH
Cheers
Carim
 
G

Guest

This looks like what I am looking to do. However, when I put the function in
I am getting an error.
 
C

Carim

Hi JP,

Give a try to following :

=SUMPRODUCT(--Value(LEFT(A1:A12,1))*--(RIGHT(A1:A12,1)="H"))

HTH
Cheers
Carim
 

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