# counting characters and sumif

#### Becky Lindholm

##### New Member
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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi,

Try:

=SUMPRODUCT(--(LEN(A1:A9)<4),--(LEN(A1:A9)>0),B1:B9)

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)

1,203,437
Messages
6,055,375
Members
444,781
Latest member
rishivar

### 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.

### Which adblocker are you using?

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

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