Counting unique values

HardBeatZ

New Member
Joined
Aug 11, 2009
Messages
11
Hello everyone!

I have a list of clients who visit different locations on different days. I need to count the number of unique clients that are visiting each center on the various days.

The client data is sensitive so I am unable to share the details however below is how the data is put together


Date First Name Last Name Center

01/04/18 John Doe Center 12
01/15/18 Jane Doe Center 11

I then have a table built that lists each center in column A with a cell that allows me to switch the date and am trying to get the number of unique clients in cell B.

I tried using a sum if using frequency, but I keep ending up off by 1, I figured this was due to formulas being written in cells that did not contain data yet so I had it subtract one from every center, but then two of my centers were off by the other way.

I know I can use countifs to come up with a solution, but my understanding is that countifs can be data extensive when using large amounts of data and this could be data that goes up to about 100,000 rows.

I'm clearly missing something just don't know what it is.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
I am not sure how you have your cell that allows you to switch the date set up so I am not sure how you would tie this into that but you can use this.

I set up a sheet as mentioned with the columns (Date / First Name /Last Name / Center ) - Columns A, B, C, D

I then put in sample data


DateFirst NameLast NameCenter
01/04/2018JohnDoeCenter 12
01/15/2018JaneDoeCenter 11
01/15/2018JamesDoeCenter 5
01/20/2018JillDoeCenter12
01/20/2018JackDoeCenter 5
01/20/2018JoeDoeCenter 6
01/20/2018JannaDoeCenter 5
01/23/2018JonDoeCenter 6
01/23/2018JimDoeCenter 12
01/23/2018JennyDoeCenter 11
01/24/2018JoAnnDoeCenter 12
01/24/2018JennaDoeCenter 11
01/24/2018JamieDoeCenter 11

<tbody>
</tbody>


Then in the same sheet I entered off to the right, I put a date in Cell I1 - This is where it pulls the date for use in our formula. You would change the date in Cell I1 to change the counts in you list of Centers.

With the date in Cell I1 I then Create A list of Centers on the same sheet, again this is just for demonstration, you will need to adjust for your use. I put my list of centers on the same sheet in Column Q.

Next to the center list in column R i enter the formula

Code:
=COUNTIFS(D:D,Q2,A:A,$I$1)


And then copy this down through the list of Centers. Note the locked cells in the formula ($)

 
Last edited:
Upvote 0
Maybe something like this:
You are right that COUNTIFS can slow things down when you have large amounts of data.
I'm assuming you have no blank cells in your data. If you do we may have to make a few changes.

This is an array formula and must be entered with CTRL-SHIFT-ENTER
Drag formula down as needed.
Excel Workbook
ABCD
1DateFirst NameLast NameCenter
21/4/2018JohnDoeCenter 12
31/20/2018JaneDoeCenter 11
41/20/2018JaneDoeCenter 11
51/20/2018JillDoeCenter 12
61/20/2018JackDoeCenter 5
71/20/2018JoeDoeCenter 6
81/20/2018JannaDoeCenter 5
91/23/2018JonDoeCenter 6
101/23/2018JimDoeCenter 12
111/23/2018JennyDoeCenter 11
121/24/2018JoAnnDoeCenter 12
131/24/2018JennaDoeCenter 11
141/24/2018JamieDoeCenter 11
15
16
17Date1/20/2018
18CenterUnique Count
19Center 52
20Center 61
21Center 111
22Center 121
Sheet
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

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