Count of unique list.

Karthik23

New Member
Joined
Jul 15, 2022
Messages
15
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hello,

Could anyone please help with the formula in 'Count' field. We need the unique user count considering the time for past 10mins.

Below is an example set for reference.

Thanks in advance!

NameTimeCountComment
A
10/1/2021 9:06​
1
B
10/1/2021 9:26​
1
B
10/1/2021 9:26​
1
C
10/1/2021 11:01​
2Here the count is 2 (C=1, D=1) because User D has to be counted from (10:53 to 11:02).
D
10/1/2021 11:02​
1Here the count will be 1 because the user is same at 11:02 in below line.
D
10/1/2021 11:02​
1
E
10/1/2021 11:29​
1
F
10/1/2021 11:45​
1
G
10/1/2021 14:55​
1
H
9/2/2022 9:39​
2Here the count is 2 (H=1, C=1) because User C has to be counted from (9:30 to 9:39).
C
9/2/2022 9:39​
1
 

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.
Could anyone please help with the formula in 'Count' field. We need the unique user count considering the time for past 10mins.

NameTimeCountComment
A
10/1/2021 9:06​
1
B
10/1/2021 9:26​
1
B
10/1/2021 9:26​
1
C
10/1/2021 11:01​
2Here the count is 2 (C=1, D=1) because User D has to be counted from (10:53 to 11:02).
D
10/1/2021 11:02​
1Here the count will be 1 because the user is same at 11:02 in below line.
D
10/1/2021 11:02​
1
E
10/1/2021 11:29​
1
F
10/1/2021 11:45​
1
G
10/1/2021 14:55​
1
H
9/2/2022 9:39​
2Here the count is 2 (H=1, C=1) because User C has to be counted from (9:30 to 9:39).
C
9/2/2022 9:39​
1

I do not understand your expected results. For example, at 10/1/2021 11:01 as far as I understand it, there was only 1 user in the previous 10 minutes (user C).

It seems to me to be the same question that you asked here except that now the date and time are combined into one column, not two.
If that is the case, then I would be suggesting this variation of my previous formula.

Karthik23.xlsm
ABC
1NameTimeCount
2A1/10/2021 9:061
3B1/10/2021 9:261
4B1/10/2021 9:261
5C1/10/2021 11:011
6D1/10/2021 11:022
7D1/10/2021 11:022
8E1/10/2021 11:291
9F1/10/2021 11:451
10G1/10/2021 14:551
11H2/09/2022 9:391
12C2/09/2022 9:392
Sheet2
Cell Formulas
RangeFormula
C2:C12C2=ROWS(UNIQUE(FILTER(A$2:A2,(B$2:B2>=B2-TIME(0,10,0))*(B$2:B2<=B2))))
 
Upvote 0
Hello,

Could anyone please help with the formula in 'Count' field. We need the unique user count considering the time for past 10mins.

Below is an example set for reference.

Thanks in advance!

NameTimeCountComment
A
10/1/2021 9:06​
1
B
10/1/2021 9:26​
1
B
10/1/2021 9:26​
1
C
10/1/2021 11:01​
2Here the count is 2 (C=1, D=1) because User D has to be counted from (10:53 to 11:02).
D
10/1/2021 11:02​
1Here the count will be 1 because the user is same at 11:02 in below line.
D
10/1/2021 11:02​
1
E
10/1/2021 11:29​
1
F
10/1/2021 11:45​
1
G
10/1/2021 14:55​
1
H
9/2/2022 9:39​
2Here the count is 2 (H=1, C=1) because User C has to be counted from (9:30 to 9:39).
C
9/2/2022 9:39​
1
 
Upvote 0
Hi Peter,

Thanks for the revert!

My requirement is little different from the old one. Hence, requested in the new thread.

The formula which you have provided is not fulfilling my requirement. The count for user 'C' should be 2 and not 1. The reason is, user 'D' has logged in at 11:02, considering his last 10mins i.e, 10:53 to 11:02, the user 'D' has to be counted '1' and in between user 'C' has already entered at 11:01 (which is in between of 10:53 to 11:02). Hence the count is 2 (C+D = 1+1 =2).

Hope this is clear!

NameTimeCountComment
A10/1/2021 9:061
B10/1/2021 9:261
B10/1/2021 9:261
C10/1/2021 11:012Here the count is 2 (C=1, D=1) because User D has to be counted from (10:53 to 11:02).
D10/1/2021 11:021Here the count will be 1 because the user is same at 11:02 in below line.
D10/1/2021 11:021
E10/1/2021 11:291
F10/1/2021 11:451
G10/1/2021 14:551
H9/2/2022 9:392Here the count is 2 (H=1, C=1) because User C has to be counted from (9:30 to 9:39).
C9/2/2022 9:391

Appreciate your efforts!
 
Upvote 0
Hope this is clear!
It is not to me.

C10/1/2021 11:012Here the count is 2 (C=1, D=1) because User D has to be counted from (10:53 to 11:02).
In this line, where did you get 10:53 to 11:02 from? It seems to have nothing to do with 11:01

H9/2/2022 9:392Here the count is 2 (H=1, C=1) because User C has to be counted from (9:30 to 9:39).
C9/2/2022 9:391
In the first row here you say H=1, C=1 gives 2 because both H & C has to be counted from 9:30 to 9:39.
If both h & C has to be counted from 9:30 to 9:39 then why isn't the bottom row also 2 since again both H & C are in 9:30 to 9:39?
 
Upvote 0
C10/1/2021 11:012Here the count is 2 (C=1, D=1) because User D has to be counted from (10:53 to 11:02).
In this line, where did you get 10:53 to 11:02 from? It seems to have nothing to do with 11:01

In this requirement, we should consider the next lines if any user enters within 10mins range. Hence, we are considering user 'D' who has entered at 11:02 (past 10mins for 11:02 is 10:53 to 11:02). In between user 'C' has also entered at 11:01. So the count should be '2'.

H9/2/2022 9:392Here the count is 2 (H=1, C=1) because User C has to be counted from (9:30 to 9:39).
C9/2/2022 9:391
In the first row here you say H=1, C=1 gives 2 because both H & C has to be counted from 9:30 to 9:39.
If both h & C has to be counted from 9:30 to 9:39 then why isn't the bottom row also 2 since again both H & C are in 9:30 to 9:39?

As we don't have any other user logged in after 9:39, the count for user 'C' is 1. Whereas for 'H' we can see user 'C' has entered at same time so the count for 'H' is 2.
 
Upvote 0
You keep referring to "past 10 minutes" but from the expected results, all I can assume is that you actually mean in the "next 10 minutes". If that is the case, then try this.

Karthik23.xlsm
ABC
1NameTimeCount
2A1/10/2021 9:061
3B1/10/2021 9:261
4B1/10/2021 9:261
5C1/10/2021 11:012
6D1/10/2021 11:021
7D1/10/2021 11:021
8E1/10/2021 11:291
9F1/10/2021 11:451
10G1/10/2021 14:551
11H2/09/2022 9:392
12C2/09/2022 9:391
Sheet2
Cell Formulas
RangeFormula
C2:C12C2=ROWS(UNIQUE(FILTER(A2:A$12,(B2:B$12<=B2+TIME(0,10,0))*(B2:B$12>=B2))))
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,639
Members
449,093
Latest member
Ahmad123098

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