Formula for Time - Unique user Count.

Sindhura

New Member
Joined
Oct 7, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a requirement where I would need help with the formula (in count field). Below is my requirement. Please help.
As per the given table, i need formula for "Count" field for every past 10minutes based on UNIQUE Names.


TimeCountComments
11:51 AM​
1​
11:52 AM​
1​
11:53 AM​
1​
11:54 AM​
1​
11:55 AM​
1​
11:56 AM​
1​
11:57 AM​
1​
11:58 AM​
1​
11:59 AM​
1​
Tom
12:00 PM​
1​
12:01 PM​
0​
12:11 PM​
1​
12:12 PM​
1​
12:13 PM​
1​
12:14 PM​
1​
12:15 PM​
1​
12:16 PM​
2​
Here, the count was 2 because Noddy has entered at 12:25 where 12:16 was his past 10mins.
12:17 PM​
2​
12:18 PM​
3​
Here, the count was 3 because Mario has entered at 12:29 where 12:18 was his past 10mins.
12:19 PM​
3​
Jerry
12:20 PM​
3​
12:21 PM​
2​
12:22 PM​
2​
12:23 PM​
2​
12:24 PM​
2​
Noddy
12:25 PM​
2​
12:26 PM​
1​
12:27 PM​
1​
12:28 PM​
1​
Mario
12:29 PM​
1​
12:30 PM​
0​
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Assuming it's 10 rows of data, and not 10 minutes - that is, there is one row per minute, even though 12:02 to 12:10 are missing here. And I can't figure how you have Mario starting at 12:18 instead of 12:20 - it doesn't seem consistent with Jerry and Noddy.

Also, is unique, just a unique count in the ten minutes in the future, or overall unique - meaning if they have appeared up on the list somewhere - do they never count again?

MrExcelPlayground12.xlsx
ABCDE
2TimeCountComments
311:51 AM11
411:52 AM11
511:53 AM11
611:54 AM11
711:55 AM11
811:56 AM11
911:57 AM11
1011:58 AM11
1111:59 AM11
12Tom12:00 PM11
1312:01 PM00
1412:11 PM11
1512:12 PM11
1612:13 PM11
1712:14 PM11
1812:15 PM11
1912:16 PM22Here, the count was 2 because Noddy has entered at 12:25 where 12:16 was his past 10mins.
2012:17 PM22
2112:18 PM23Here, the count was 3 because Mario has entered at 12:29 where 12:18 was his past 10mins.
2212:19 PM23
23Jerry12:20 PM33
2412:21 PM22
2512:22 PM22
2612:23 PM22
2712:24 PM22
28Noddy12:25 PM22
2912:26 PM11
3012:27 PM11
3112:28 PM11
32Mario12:29 PM11
3312:30 PM00
Sheet23
Cell Formulas
RangeFormula
C3:C33C3=IFERROR(ROWS(UNIQUE(FILTER(A3:A12,A3:A12<>""))),0)
 
Upvote 0
Hi James,

Seems my requirement was not clear earlier. To be more specific, we need unique user count by considering past 10mins.
Provided the new example to be more clear and understandable. We need formula for "Count" field . Please help!

Thank you :)

Note : If the same user is being logged in multiple times within the 10mins then the user should be counted only once considering the last timestamp.


NameTimeCountComments
12:20:00​
0
12:28:00​
0
12:38:00​
1Here we got 1 because A entered at 12:44 so considering past 10mins i.e., from 12:35 to 12:44 the count should be 1
A
12:44:35​
1
12:45:00​
0
13:15:00​
0
13:17:00​
1Here we got 1 because B entered at 13:26 so considering past 10mins i.e., from 13:17 to 13:26 the count should be 1
13:19:00​
1
B
13:26:34​
2Here we got 2 because C entered at 13:29 so considering past 10mins i.e., from 13:20 to 13:29 the count should be 1 and since B is already there (1+1 =2)
13:27:00​
1
C
13:29:56​
1
13:30:00​
0
13:38:51​
1Here we got 1 because D entered at 13:40 so considering past 10mins i.e., from 13:31 to 13:40 the count should be 1
D
13:40:51​
1
E
13:53:00​
3Here we got 3 because F & G entered at 14:00 & 14:01 so considering past 10mins i.e., from 13:51/13:52 to 14:00/14:01 the user should be counted ( E+F+G = 3)
F
14:00:14​
2Here we got 2 because G entered at 14:01 so considering past 10mins i.e., from 13:51 to 14:00 the user G has to be considered (F+G=2)
G
14:01:00​
1
 
Upvote 0
MrExcelPlayground12.xlsx
ABCDE
38NameTimeCountComments
3912:30:0000
4012:28:0000
4112:38:0011Here we got 1 because A entered at 12:44 so considering past 10mins i.e., from 12:35 to 12:44 the count should be 1
42A12:44:3511
4312:45:0000
4413:15:0000
4513:17:0011Here we got 1 because B entered at 13:26 so considering past 10mins i.e., from 13:17 to 13:26 the count should be 1
4613:19:0011
47B13:26:3422Here we got 2 because C entered at 13:29 so considering past 10mins i.e., from 13:20 to 13:29 the count should be 1 and since B is already there (1+1 =2)
4813:27:0011
49C13:29:5611
5013:30:0000
5113:38:5111Here we got 1 because D entered at 13:40 so considering past 10mins i.e., from 13:31 to 13:40 the count should be 1
52D13:40:5111
53E13:53:0033Here we got 3 because F & G entered at 14:00 & 14:01 so considering past 10mins i.e., from 13:51/13:52 to 14:00/14:01 the user should be counted ( E+F+G = 3)
54F14:00:1422Here we got 2 because G entered at 14:01 so considering past 10mins i.e., from 13:51 to 14:00 the user G has to be considered (F+G=2)
55G14:01:0011
Sheet23
Cell Formulas
RangeFormula
C39:C55C39=IFERROR(ROWS(FILTER($A$39:$A$55,($A$39:$A$55<>"")*($B$39:$B$55>=B39)*($B$39:$B$55<B39+10/60/24))),0)
 
Upvote 0
Solution
Hi James,

Thanks for your time on this.
But the formula didn't worked out for me when I have checked : ( Sorry..
Could you please let me know if there is any alternative formula for this.

Thanks in advance!
 
Upvote 0
Since it appears to work for me, and I don't know how or why it doesn't work for you, I can't imagine what kind of alternative would be needed. If you could be more specific in what didn't work, that could be helpful.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,557
Members
449,088
Latest member
davidcom

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