Combining Match, and countIF into a vlookup?

eblake

Active Member
Joined
Aug 18, 2004
Messages
258
I have a list of agents and the times they have logged in and out of their phones, Some of them log out for a split shift, the problem I am having is to calculate their splits, I tried using Vlookup("Split",PASTE_IDLE_HERE!AU & (MATCH(D4,PASTE_IDLE_HERE!B:B,0)):AV & (MATCH(D4,PASTE_IDLE_HERE!B:B,0)+12),2,FALSE), but excel doesnt like that.

I need the formula to do 3 things,
1. Find the starting row for the agent in question:
=MATCH(D4,Paste_IDLE_here!B:B,0) 'Finds agent by extension
2. Find out how many entries we have for the agent in question:
=COUNTIF(Paste_IDLE_here!B:B,D4) 'Finds number of entries by extension
3. Look in column AU for the word split, if found report back time in column AV:
=VLOOKUP("Split",Paste_IDLE_here!AU:AV,2,FALSE)

The Vlookup works fine, except it pulls the first Split it finds and not the one for the agent that i want. Agents extension is in D4 fyi. I'm sure there is a better way to do this, I just can't seem to figure out what it is.

The agent fields look like:
Daily Aspect v5.4.xls
ABCD
35TueDOE,JOHN-MTWRF-&9AM-1PM/5PM-9PM6802
Daily_Report_To_Print


The time report looks like this:
Daily Aspect v5.4.xls
ABCDEFGHIJ
1Ext.AgentNameDateTypeofEventEventCodeEventDescriptionTimeEventDurationWorkSplitSplitTime
26802Doe,JohnAugust24,2004Signon8:59:09AM0.00NoSplit 
36802Doe,JohnAugust24,2004Idle8:59:17AM0.13NoSplit 
46802Doe,JohnAugust24,2004Idle20.00HEALTHBREAK11:57:11AM2.87NoSplit 
56802Doe,JohnAugust24,2004Idle1.001stBREAK12:54:45PM14.12NoSplit 
66802Doe,JohnAugust24,2004Idle27.00IDLE-RESEARCH1:29:46PM17.42NoSplit 
76802Doe,JohnAugust24,2004Idle3:57:15PM1.55NoSplit 
86802Doe,JohnAugust24,2004Signoff3:57:15PM0.00Split1:01
96802Doe,JohnAugust24,2004Signon4:59:14PM0.00NoSplit 
106802Doe,JohnAugust24,2004Idle4:59:19PM0.08NoSplit 
116802Doe,JohnAugust24,2004Idle7:23:55PM0.08NoSplit 
126802Doe,JohnAugust24,2004Idle47.002ndBREAK8:41:57PM14.55NoSplit 
136802Doe,JohnAugust24,2004Signoff9:39:09PM0.00NoSplit 
Sheet16


thanks in advance.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I presume PASTE_IDLE_HERE is Sheet16 in your exhibit...
Book6
ABCDEFGH
34StartEnd
3535DOE,JOHN-MTWRF-&9AM-1PM/5PM-9PM68022130.042361
36
Daily_Report_To_Print


Formulas...

F35:

=MATCH(C35,Sheet16!B:B,0)

G35:

=MATCH(C35,Sheet16!B:B,1)

H35:

=LOOKUP(2,1/(INDEX(Sheet16!I:I,$F35):INDEX(Sheet16!I:I,$G35)="Split"),INDEX(Sheet16!J:J,$F35):INDEX(Sheet16!J:J,$G35))

Caveat. The foregoing assume that the data is sorted on agents.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

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