Count numbers in column based on text

paulsolar

Well-known Member
Joined
Aug 21, 2013
Messages
691
Office Version
  1. 365
Hi All

I've seen this before but am unable to find the function to do what I require. let me explain.

In Column B, I have the number of sales a salesman has made to a customer

in Column D, I have the corresponding salesman,s name

in Column K, I have a list of salesmen

i'd like to total all the sales per salesman to all their customers (from column B) next to the salesman in column L

An example would be, John has 5 customers in column B with his name next to these in column D.

each customer has bought 5 items, therefore if john was in K1 then L1 would be 25

Sorry it's such a terrible explanation.

Any help would be appreciated, i know the formula needs to be in L1 but cant for the life of me think what it should be

Cheers

Paul
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Busy right now, but this sounds like a good case for a COUNTIFS formula, try and work through it and see if you can make it work. I'm sure there are other was as well.

Also, if you post some sample data with the results you expect it is always helpful.
 
Upvote 0
Hi, I've been looking at Sumif's and cant seem to get it to work

I'll try countifs:rolleyes:
 
Upvote 0
Got it

=SUM(SUMIFS($B$3:$B$386,$D$3:$D$386,K3))

all i need to do know is work out how to do this in VBA and I'm sorted :-)
 
Upvote 0
I don't think you need to wrap the SUMFIS with the sum, that is redundant, but not hurting anything.

I came up with this also, and I agree SUMIFS was needed not COUNTIFS, sorry about that.

Code:
=SUMIFS($B:$B,$D:$D,K$1)

As for VBA, that is beyond my knowledge, but there are a lot of people on here I"m sure can help with that.
 
Upvote 0
Thanks for your help, i thought i was going mad, you helped me look at it again which was what was required.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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