sumif and wildcards

  • Thread starter Thread starter oscarcounts
  • Start date Start date
O

oscarcounts

I column B I have code numbers, 4 and 5 digit. In column E I have
corresponding financial values. I want to sum values which correspond to
sections of code numbers. ie by reading the first two or three digits of
grouped code number.
 
Perhaps something like this:

3 digit
=SUMPRODUCT((LEFT(B2:B100,3)="111")*E2:E100)

2 digit
=SUMPRODUCT((LEFT(B2:B100,2)="11")*E2:E100)
 
=SUMIF(B2:B100,"111*",E2:E100)

and so on

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Thank you for this formula. It works if I modify the array in line with the
codes. The difficulty I have is that in some cases the first three digits of
the 4 and 5 digit codes are the same. Is there a remedy?
 
Maybe, using MID instead of LEFT in the earlier expression
Post some examples of your data in col B
 

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