Sum formula help

H

HaSt2307

To All,
I was wondering if anyone has a way to shorten the following formula
or is what I have the best way? I tried using Index and Match, but
could not figure out how to do it.

SUMPRODUCT(--(LEFT($B$4:$B$14,3)="200"),$F$4:$F$14)+SUMPRODUCT(--(LEFT($B$4:$B$14,3)="300"),$F$4:$F$14)+SUMPRODUCT(--(LEFT($B$4:$B$14,3)="500"),$F$4:$F$14)

Thanks
Harry
 
M

Mike H

Hi,

A bit shorter

=SUMPRODUCT(--(ISNUMBER(SEARCH({200,300,500},LEFT(B4:B14,3)))*(F4:F14)))

Mike
 
L

Lars-Åke Aspelin

A bit shorter, but maybe not so clear

=SUMPRODUCT((1-ISERR(FIND({200,300,500},LEFT(B4:B14,3))))*(F4:F14))

or

=SUM((1-ISERR(FIND({200,300,500},LEFT(B4:B14,3))))*(F4:F14))

entered as an array formula (CTRL+SHIFT+ENTER)

Lars-Åke
 
T

T. Valko

If these are alpha-numeric codes that are actually text strings:

=SUM(SUMIF(B4:B14,{"200*","300*","500*"},F4:F14))
 
H

HaSt2307

Mike,
Thanks, I knew there had to be a shorter way, but I could not seem to
find the right solution.

Harry
 
H

HaSt2307

Lars,
Your solution works fine and I will have to study this a little more
to get fully understand it.

Harry
 
H

HaSt2307

Biff,
Yes they are in text strings i.e. 300 - Misc Income and your solution
also works. I will have to also file this one away for later use.

Harry
 

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