First and Last instances

byorj

New Member
Joined
Feb 28, 2020
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hello,

Does anyone know a formula for getting the first and last instance of an agent in a data set, so I can record every agents log in and log out times from a big long list of all times

Thanks,
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Struggling to get this working when there is multiple statuses.

1582893838957.png


I've removed names but the same people do recur again. Is there a way of logging their first time that isn't offline regardless of what the next status is?
 
Upvote 0
I think it would help if you substituted the real names with eg. Agent1, Agent2 etc so that we can see how the rows of data relate to given agents. Also, illustrate the output that you would want to get from the sample data. Ideally, download XL2BB (in the posting Menu bar) so that members can easily replicate your example and, hopefully, find you a solution.
 
Upvote 0
Sure, so the data set like this

1582901317080.png


and I wanted to get something like this as the result.

1582901352538.png
 
Upvote 0
Then maybe something like below
Book1
ABCDEFGH
1AgentsStatusStartEnd AgentInOut
2Agent1Offline27/01/202002/02/2020 23:59:59Agent1 07:43:03 07:58:35
3Agent2Offline27/01/202002/02/2020 23:59:59Agent2 05:00:41 07:43:03
4Agent3Offline27/01/202028/01/2020 05:00:41Agent3 06:21:06 08:15:34
5Agent2Chat28/01/2020 05:00:4128/01/2020 06:21:06
6Agent3Away28/01/2020 06:21:0628/01/2020 06:34:30
7Agent2Chat28/01/2020 06:34:3028/01/2020 07:09:09
8Agent3Meeting/1:128/01/2020 07:25:3128/01/2020 07:42:59
9Agent2Available28/01/2020 07:42:5928/01/2020 07:43:03
10Agent1On A Call28/01/2020 07:43:0328/01/2020 07:52:08
11Agent3After Call Work28/01/2020 07:52:0828/01/2020 07:54:07
12Agent1Available28/01/2020 07:54:0728/01/2020 07:54:12
13Agent1On A Call28/01/2020 07:54:1228/01/2020 07:58:35
14Agent3After Call Work28/01/2020 07:58:3528/01/2020 08:00:35
15Agent3Available28/01/2020 08:15:3428/01/2020 08:15:34
Sheet1
Cell Formulas
RangeFormula
G2:G4G2{=INDEX($C$1:$C$15,MATCH(1,($A$1:$A$15=F2)*($B$1:$B$15<>"Offline"),0))}
H2:H4H2{=INDEX($D$1:$D$15, MATCH(2,1/($A$1:$A$15=F2)))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.


Hope that helps.
 
Upvote 0
That works great for the start, but I get all off the offlines at

2020-02-02 23:59:59


Is there a way to include the offline too into the end?
 
Upvote 0
1582910619656.png


it shows like this as offline is included as a status in end, is there a way to remove this from out as well
 
Upvote 0
Try..
Book1
ABCDEFGH
1AgentsStatusStartEnd AgentInOut
2Agent1Offline27/01/202002/02/2020 23:59:59Agent1 07:43:03 07:58:35
3Agent2Offline27/01/202002/02/2020 23:59:59Agent2 05:00:41 07:43:03
4Agent3Offline27/01/202028/01/2020 05:00:41Agent3 06:21:06 08:15:34
5Agent2Chat28/01/2020 05:00:4128/01/2020 06:21:06
6Agent3Away28/01/2020 06:21:0628/01/2020 06:34:30
7Agent2Chat28/01/2020 06:34:3028/01/2020 07:09:09
8Agent3Meeting/1:128/01/2020 07:25:3128/01/2020 07:42:59
9Agent2Available28/01/2020 07:42:5928/01/2020 07:43:03
10Agent1On A Call28/01/2020 07:43:0328/01/2020 07:52:08
11Agent3After Call Work28/01/2020 07:52:0828/01/2020 07:54:07
12Agent1Available28/01/2020 07:54:0728/01/2020 07:54:12
13Agent1On A Call28/01/2020 07:54:1228/01/2020 07:58:35
14Agent3After Call Work28/01/2020 07:58:3528/01/2020 08:00:35
15Agent3Available28/01/2020 08:15:3428/01/2020 08:15:34
16Agent3Offline02/02/2020 23:59:5902/02/2020 23:59:59
Sheet1
Cell Formulas
RangeFormula
G2:G4G2{=INDEX($C$1:$C$16,MATCH(1,($A$1:$A$16=F2)*($B$1:$B$16<>"Offline"),0))}
H2:H4H2{=INDEX($D$1:$D$16, MATCH(2,1/(($A$1:$A$165=F2)*($B$1:$B$16<>"Offline"))))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

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