Count Unique items based on criteria

trenteb

New Member
Joined
Dec 19, 2023
Messages
7
Office Version
  1. 2021
Platform
  1. Windows
I have a set of sales data by date by location and by customer. I want to be able to count the customers who have purchased by month by location, whether they have purchased multiple times during the month or just once doesn't matter they should only be counted once as trying to ascertain the number of active customers.

Note - not able to post mini sheet, not being provided with option?
 

Attachments

  • countsample.png
    countsample.png
    18.9 KB · Views: 9

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Cannot manipulate data in a picture. Please reload to this site using XL2BB so that we don't have to retype your data. Additionally, cannot read your data as it is all black and very indistinguishable.
 
Upvote 0
would love to however - only being provided option to upload an image. I'm sure user error/ignorance at play here - if you have any insight as to what I need to do to get the option to load mini sheet they are welcome.
1703045430139.png
 
Upvote 0
 
Upvote 0
Not sure this is what you are after, it is a copy and paste of the Mini sheet data

Samplecount1.xlsx
BCD
4MonthSales OfficeCustomer Name
530/11/2023ROCCustomer A
620/11/2023ROCCustomer A
730/11/2023ABCCustomer C
830/11/2023SHECustomer E
930/11/2023SHECustomer F
1031/10/2023ROCCustomer A
1131/10/2023ABCCustomer C
1231/10/2023ABCCustomer D
1331/10/2023SHECustomer E
1420/10/2023SHECustomer F
1512/10/2023SHECustomer F
1630/09/2023ROCCustomer A
1720/09/2023ROCCustomer A
1830/09/2023ROCCustomer B
1930/09/2023ABCCustomer C
2027/09/2023ABCCustomer C
2112/09/2023ABCCustomer C
2230/09/2023SHECustomer E
2312/09/2023SHECustomer E
2431/08/2023ROCCustomer B
2531/08/2023ABCCustomer C
2631/08/2023ABCCustomer D
2731/08/2023SHECustomer E
2812/08/2023SHECustomer E
2910/08/2023SHECustomer E
3031/08/2023SHECustomer F
3131/07/2023ABCCustomer C
3231/07/2023ABCCustomer C
3331/07/2023ABCCustomer C
3431/07/2023ABCCustomer D
3531/07/2023SHECustomer G
3631/07/2023SHECustomer F
3712/07/2023SHECustomer F
387/07/2023SHECustomer F
3931/07/2023SHECustomer E
Sheet1
 
Upvote 0
Not sure this is what you are after,
Yes, that is it exactly. BTW, I had mentioned XL2BB and given you a link to it a day or so ago in your other thread. :)
Welcome to the MrExcel board!

For the future, it would help greatly if you provided sample data (& expected results) with XL2BB so helpers don't have to manually type out sample data to test with & show results. :)

See if this is what you want

trenteb.xlsm
BCDEFGHI
4MonthSales OfficeCustomer NameABCROCSHE
530/11/2023ROCCustomer AJul-23203
620/11/2023ROCCustomer AAug-23212
730/11/2023ABCCustomer CSep-23121
830/11/2023SHECustomer EOct-23212
930/11/2023SHECustomer FNov-23112
1031/10/2023ROCCustomer A
1131/10/2023ABCCustomer C
1231/10/2023ABCCustomer D
1331/10/2023SHECustomer E
1420/10/2023SHECustomer F
1512/10/2023SHECustomer F
1630/09/2023ROCCustomer A
1720/09/2023ROCCustomer A
1830/09/2023ROCCustomer B
1930/09/2023ABCCustomer C
2027/09/2023ABCCustomer C
2112/09/2023ABCCustomer C
2230/09/2023SHECustomer E
2312/09/2023SHECustomer E
2431/08/2023ROCCustomer B
2531/08/2023ABCCustomer C
2631/08/2023ABCCustomer D
2731/08/2023SHECustomer E
2812/08/2023SHECustomer E
2910/08/2023SHECustomer E
3031/08/2023SHECustomer F
3131/07/2023ABCCustomer C
3231/07/2023ABCCustomer C
3331/07/2023ABCCustomer C
3431/07/2023ABCCustomer D
3531/07/2023SHECustomer G
3631/07/2023SHECustomer F
3712/07/2023SHECustomer F
387/07/2023SHECustomer F
3931/07/2023SHECustomer E
Sheet1
Cell Formulas
RangeFormula
G4:I4G4=TRANSPOSE(UNIQUE(SORT(C5:C39)))
F5:F9F5=UNIQUE(TEXT(SORT(B5:B39),"mmm-yy"))
G5:I9G5=IFNA(ROWS(UNIQUE(FILTER($D$5:$D$39,(TEXT($B$5:$B$39,"mmm-yy")=$F5)*($C$5:$C$39=G$4),NA()))),0)
Dynamic array formulas.
 
Upvote 0
worked a treat - thank you kindly. Can you assist if I added another criteria ie. how many unique customers have purchased in a category by location? see data below

Copy of Samplecount2.xlsx
BCDE
4MonthSales OfficeCategoryCustomer Name
530/11/2023ROCBlackCustomer A
620/11/2023ROCBlackCustomer A
730/11/2023ABCGreenCustomer C
830/11/2023SHEGreenCustomer E
930/11/2023SHEBlackCustomer F
1031/10/2023ROCYellowCustomer A
1131/10/2023ABCBlackCustomer C
1231/10/2023ABCGreenCustomer D
1331/10/2023SHEYellowCustomer E
1420/10/2023SHEYellowCustomer F
1512/10/2023SHEGreenCustomer F
1630/09/2023ROCBlackCustomer A
1720/09/2023ROCYellowCustomer A
1830/09/2023ROCYellowCustomer B
1930/09/2023ABCYellowCustomer C
2027/09/2023ABCGreenCustomer C
2112/09/2023ABCGreenCustomer C
2230/09/2023SHEGreenCustomer E
2312/09/2023SHEBlackCustomer E
2431/08/2023ROCBlackCustomer B
2531/08/2023ABCBlackCustomer C
2631/08/2023ABCGreenCustomer D
2731/08/2023SHEGreenCustomer E
2812/08/2023SHEGreenCustomer E
2910/08/2023SHEYellowCustomer E
3031/08/2023SHEYellowCustomer F
3131/07/2023ABCGreenCustomer C
3231/07/2023ABCGreenCustomer C
3331/07/2023ABCGreenCustomer C
3431/07/2023ABCYellowCustomer D
3531/07/2023SHEYellowCustomer G
3631/07/2023SHEBlackCustomer F
3712/07/2023SHEBlackCustomer F
387/07/2023SHEGreenCustomer F
3931/07/2023SHEGreenCustomer E
Sheet1
 
Upvote 0
Could we add a helper column?

trenteb.xlsm
BCDEFGHIJK
4Monthmmm-yySales OfficeCategoryCustomer Name
530/11/2023Nov-23ROCBlackCustomer AJul-23SHEGreen2
620/11/2023Nov-23ROCBlackCustomer AJul-23SHEBlack1
730/11/2023Nov-23ABCGreenCustomer CJul-23ABCGreen1
830/11/2023Nov-23SHEGreenCustomer EJul-23ABCYellow1
930/11/2023Nov-23SHEBlackCustomer FJul-23SHEYellow1
1031/10/2023Oct-23ROCYellowCustomer AAug-23SHEYellow2
1131/10/2023Oct-23ABCBlackCustomer CAug-23SHEGreen1
1231/10/2023Oct-23ABCGreenCustomer DAug-23ROCBlack1
1331/10/2023Oct-23SHEYellowCustomer EAug-23ABCBlack1
1420/10/2023Oct-23SHEYellowCustomer FAug-23ABCGreen1
1512/10/2023Oct-23SHEGreenCustomer FSep-23ABCGreen1
1630/09/2023Sep-23ROCBlackCustomer ASep-23SHEBlack1
1720/09/2023Sep-23ROCYellowCustomer ASep-23ROCYellow2
1830/09/2023Sep-23ROCYellowCustomer BSep-23ROCBlack1
1930/09/2023Sep-23ABCYellowCustomer CSep-23ABCYellow1
2027/09/2023Sep-23ABCGreenCustomer CSep-23SHEGreen1
2112/09/2023Sep-23ABCGreenCustomer COct-23SHEGreen1
2230/09/2023Sep-23SHEGreenCustomer EOct-23SHEYellow2
2312/09/2023Sep-23SHEBlackCustomer EOct-23ROCYellow1
2431/08/2023Aug-23ROCBlackCustomer BOct-23ABCBlack1
2531/08/2023Aug-23ABCBlackCustomer COct-23ABCGreen1
2631/08/2023Aug-23ABCGreenCustomer DNov-23ROCBlack1
2731/08/2023Aug-23SHEGreenCustomer ENov-23ABCGreen1
2812/08/2023Aug-23SHEGreenCustomer ENov-23SHEGreen1
2910/08/2023Aug-23SHEYellowCustomer ENov-23SHEBlack1
3031/08/2023Aug-23SHEYellowCustomer F
3131/07/2023Jul-23ABCGreenCustomer C
3231/07/2023Jul-23ABCGreenCustomer C
3331/07/2023Jul-23ABCGreenCustomer C
3431/07/2023Jul-23ABCYellowCustomer D
3531/07/2023Jul-23SHEYellowCustomer G
3631/07/2023Jul-23SHEBlackCustomer F
3712/07/2023Jul-23SHEBlackCustomer F
387/07/2023Jul-23SHEGreenCustomer F
3931/07/2023Jul-23SHEGreenCustomer E
Sheet2
Cell Formulas
RangeFormula
H5:J29H5=UNIQUE(SORTBY(C5:E39,B5:B39))
K5:K29K5=ROWS(UNIQUE(FILTER(F$5:F$39,(C$5:C$39=H5)*(D$5:D$39=I5)*(E$5:E$39=J5))))
C5:C39C5=TEXT(B5,"mmm-yy")
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,216,083
Messages
6,128,718
Members
449,465
Latest member
TAKLAM

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