counting characters and sumif

Becky Lindholm

New Member
Joined
Sep 14, 2005
Messages
17
LYNA-Z $412,458.72
SBC $54,411.90
BP $55,971.50
NWL $52,095.00
LNT $58,260.00
MEL $62,021.80
XOM $65,446.20
USB $58,968.00
MMM $96,836.54

I need to write a formula that will see how many characters are in each cell of the first column. If there are 1, 2 or 3 characters it will sum the corresponding value. If there are more than three characters I don't want the corresponding value included in the sum. I would appreciate any assistance. Thanks!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Becky Lindholm said:
LYNA-Z $412,458.72
SBC $54,411.90
BP $55,971.50
NWL $52,095.00
LNT $58,260.00
MEL $62,021.80
XOM $65,446.20
USB $58,968.00
MMM $96,836.54

I need to write a formula that will see how many characters are in each cell of the first column. If there are 1, 2 or 3 characters it will sum the corresponding value. If there are more than three characters I don't want the corresponding value included in the sum. I would appreciate any assistance. Thanks!

1.

=SUM(SUMIF(A2:A10,{"?","??","???"},B2:B10))

2.

=SUMPRODUCT(--(A2:A10<>""),--(LEN(A2:A10)<=3),B2:B10)
 
Upvote 0

Forum statistics

Threads
1,224,271
Messages
6,177,610
Members
452,785
Latest member
3110vba

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top