# Sumif(s) or Sumproduct by name and by first two digits

#### Funktion

##### New Member
Hi,

I'm not having any luck getting a formula to work when I try to include a name match as well as the first two digits of an account code.

Column A contains a four-digit account code. Some of them start with 54.
Column B has a name.
Column C has amounts.

GOAL: Get the total amount for each name when the account code starts with 54.

I must be doing something wrong with the LEFT function. I've tried sumif, sumifs, and sumproduct formulas, and they either don't work, or spill, which won't work for my sheet..

I'm unable to download the tool in order to upload an actual spreadsheet, but I'll attach an image of a dummy dataset. I colored all the account codes that start with 54 green so they are easily identified as what should be included in the various totals.

Frustrating when it seems like it could be simple, but I can't get it to cooperate. Any advice would be appreciated.

#### Attachments

• Dummy Data for Funktion 2022.01.10.jpg
131.6 KB · Views: 15

### Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Excel Formula:
``=SUM(FILTER(C4:C100,(LEFT(A4:A100,2)="54")*(B4:B100=E4),0))``

Replies
3
Views
169
Replies
1
Views
219
Replies
1
Views
312
Replies
18
Views
255
Replies
1
Views
95

1,196,269
Messages
6,014,352
Members
441,816
Latest member
Klingon1960

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