If statement - begins with

  • Thread starter Thread starter grantr
  • Start date Start date
G

grantr

Anyone know how to create an if statement that would say, if any cells in the
column begin with B, sum the values in the column next to them.
 
Not an IF statement, but:
=SUMPRODUCT((LEFT(A1:A100)="B")*(B1:B100))
 
If your range with values possibly starting with B is A1:A10 and your range
with the values you want to sum is B1:B10 and you want the answer in C1 put
this formula in C1: =SUMIF(A1:A10,"B*",B1:B10) The formula is case
insensitive - B = b.

tyro
 
David, your formula partially worked for me. Can I compute a percentage
instead of sum? SUMPRODUCT(--(B1:B100>0),--(B1:B100<=100)/COUNT(B1:B100))

=SUMPRODUCT(((A1:A100)="B")*(B1:B100))

Thanks in advance.
Rene
 
This worked...

=SUMPRODUCT((M2:M10)="b")--SUMPRODUCT(--(F2:F10>0),--(F2:F10<=105))/COUNT(F2:F10)
 

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

Back
Top