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

Funktion

New Member
Joined
Mar 25, 2016
Messages
31
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
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
    Dummy Data for Funktion 2022.01.10.jpg
    131.6 KB · Views: 33

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
How about
Excel Formula:
=SUM(FILTER(C4:C100,(LEFT(A4:A100,2)="54")*(B4:B100=E4),0))
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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