I am using index/match to locate the next item in a list that matches criteria. The list is showing when users in a call center are logging in and out of the phone queue. For every LOGIN in Column J, column K has a formula that should find the next LOGOUT in Column J associated with the same extension. For some reason, about 35% of them return N/A even though the instance does exist and can be found if I change the formula to be static.
The formula is =IF(AND(J2="LOGIN",H2),INDEX(E3:E$6000,MATCH((I2+1.00001),I3:I$6000,0))-E2,"") and essentially looks in column I for a uniquely numbered entry for logout. I use the WHOLE NUMBERS to represent unique entries for each extension, then I use .xxxx for the extension, and then I use .0000x for whether it is a LOGIN or LOGOUT. so to find a logout, it adds 1.00001. for instance, the login at the very top of the file shows 1.71151 in Col. I, because it is the 1st instance of 7115, and the 1 at in the 0.0000x place says it is a login. a logout would be a 2 afterwards, so to find the very next LOGOUT for extension 7115, it needs to find 2.71152.
I hope this makes sense. I feel like its kind of confusing. Maybe theres an altogether better way. Basically, for each extension I want to know the elapsed time between each LOGIN/LOGOUT. Only the green highlighted lines mean anything, the rest is all junk data produced by the report. So it needs to locate the next UNIQUE logout. I attached the file so someone might be able to see the #N/A errors and tell me why they are happening so randomly, or provide me with a better way to do what I need to.
https://www.dropbox.com/sh/hwf6bt6zh3x5a8l/u0D1MkKdcH/Agent%20Availability.xlsx
The formula is =IF(AND(J2="LOGIN",H2),INDEX(E3:E$6000,MATCH((I2+1.00001),I3:I$6000,0))-E2,"") and essentially looks in column I for a uniquely numbered entry for logout. I use the WHOLE NUMBERS to represent unique entries for each extension, then I use .xxxx for the extension, and then I use .0000x for whether it is a LOGIN or LOGOUT. so to find a logout, it adds 1.00001. for instance, the login at the very top of the file shows 1.71151 in Col. I, because it is the 1st instance of 7115, and the 1 at in the 0.0000x place says it is a login. a logout would be a 2 afterwards, so to find the very next LOGOUT for extension 7115, it needs to find 2.71152.
I hope this makes sense. I feel like its kind of confusing. Maybe theres an altogether better way. Basically, for each extension I want to know the elapsed time between each LOGIN/LOGOUT. Only the green highlighted lines mean anything, the rest is all junk data produced by the report. So it needs to locate the next UNIQUE logout. I attached the file so someone might be able to see the #N/A errors and tell me why they are happening so randomly, or provide me with a better way to do what I need to.
https://www.dropbox.com/sh/hwf6bt6zh3x5a8l/u0D1MkKdcH/Agent%20Availability.xlsx