Admins: Sorry for posting a similar post to the one i did before, couldnt find a delete post button so pls feel free to delete my earlier posts.
Anyway, Need some help constructing a formula and im not too sure which function to use.
Im also not sure if its even possible or im missing a required column to help make it possible.
Pls take a look at this scenario, and tell me if its possible to do.
//
(arrival Time)---(c1)---(c2)-(served by)--(time served)-----(exit time)
-------A----------B-----C--------D------------E----------------F
1----9.00am-----0-----0--------1------------2mins-----------9.02am
2----9.01am-----1-----0--------2------------15mins----------9.16am
3----9.05am-----0-----1--------1------------2mins-----------9.07am
4----9.06am-----1-----1--------?------------xmins-----------x.xxam
Column A = Arrival time
Column B = Number of customers in Counter #1 as of arrival time
Column C = Number of customers in Counter #2 as of arrival time
Column D = to be Served By Counter:
Column E = Mins being served before exiting the counter/que
Column F = exit time
rows = customers entering a que
*note - a counter can only serve 1 customer, and if both are free, counter 1 gets preference.
---------------
Walkthrough
---------------
Customer 1 arrives at 9am, theres no one in counter 1 or 2, he gets served by counter 1. he takes 2 mins, and exits at 9.02am.
Customer 2 arrives at 9.01am, counter 1 is attending to customer 1, counter 2 is empty, so he goes to counter 2 and takes 15 mins, exits at 9.16am.
Customer 3 arrives at 9.05am, counter 1 is open, while counter 2 is still atending to customer 2, he goes to counter 1 and takes 2 min, he exits at 9.07am.
Customer 4 arrives at 9.06am, both counters are busy, so he waits in the que.
Problem : Logically from the above figure we can see that since customer 3 at counter 1 finishes at 9.07am, and customer 2 finishes at counter 2 at 9.16am, so customer 4 should be served next by counter 1 which will be open sooner than counter 2. However i cant seem to figure out how to create a formula for column D.
Basically in english it should be something like :
if B4 = 0, return 1 in D4
else
if C4 = 0, return 1 in D4
else
if B4 AND C4 = 1, lookup the last 2 rows in column D1:D5 which = 1, and = 2, (it the example it should lookup and retrieve D2 and D3) and compare F2 and F3. Return the either D3 or D4 of the row with this smallest value.
Hope that makes sense, and will be eternally grateful to your comments and help.
cheers.
Bookmarks