Need recursive LAMBDA help please

greegan

Well-known Member
Joined
Nov 18, 2009
Messages
644
Office Version
  1. 365
Platform
  1. Windows
I am working on an Erlang C formula and was having trouble until I found out about LAMBDA functions. They are awesome!
My formula is currently calculating the Service Level of our contact centre with a specific number of agents. If the result does not meet the target (in this case 80%) we need to more agents until it reaches at least the target or better.
I only need help with this portion of the formula. I believe a recursive LAMBDA will work with this but I'm not comprehending the syntax. Major brain fart here. Here is what I'm thinking:

target = .8
sl = current service level = ?
n = number of agents already considered
Naming LAMBDA function SLT

=LAMBDA(sl,target,n,if(sl<target,SLT+1,0))

The issue I'm running into is that the Service Level already has a formula and will be a circular reference because it is dependent on the total of n.

I'm likely going to making the whole formula into a LAMBDA function if I can get help on the above step.

If you need more information, I can include all of the factors and functions used for the final numbers.

My formulas are based on the ErlangC formula from wikipedia

Erlang.jpg


And the explanation HERE


Thank you for your help.


-- g







If its not in my signature I'm using Office 365 for Windows 10.
 
In the last sheet that I posted, I adjusted the inputs to look like this:
1. Inputs:
Number of calls100
In a period of minutes (min)30
Average Handling Time (AHT) (s)370
Required Service Level80%
Target Answer Time (s)20
Maximum Occupancy85%
Shrinkage30%

...and the middle part of the worksheet looks like this (I tweaked the starting N formula to roundup traffic intensity A to the next whole number and then added a user-selectable incrementing factor to see what the Probabilities and Service Levels are as the number of agents are increased...those are in highlighted yellow). I don't see any issues. The Probabilities that a call has to wait decreases as agents are added, while the Service Level metric increases, finally exceeding 80 % SL when N=26. The FindN LAMBDA function (red highlighting) also returns 26. Are you seeing something different?
ErlangC_20210313_v2.xlsx
ABCDEFG
19Traffic intensity (A) , call-hours per hour (Erlang unitless)20.55555556
20
214. Estimate the raw number of agents required (N)26
22One agent max capability is 1 call-hour per hour actual time1<--increment by
23Initial guess for N agents required212223242526
24X term [in Probability, Pw = X/(X+Y)]34480336811038479823573357202.3363653391.5241383356.5162016946.8
25Y term431140842.34504115100.14572298118.80633234633.05685425629.06728338225.78
26Probability a call has to wait, Pw88.89%67.32%50.05%36.48%26.04%18.20%
27
285. Calculate the Service Level (list item #13 in ref)
29Service Level13.22%37.74%56.15%69.72%79.52%86.44%
30Target Service Level80%80%80%80%80%80%
31Target Service Level Met?FALSEFALSEFALSEFALSEFALSETRUE
ErlangC
Cell Formulas
RangeFormula
B19B19=B18/60
B21B21=FindN(B6,B8,B19,B23,B7)
B23B23=ROUNDUP(B19,0)
C23C23=ROUNDUP(B23,0)+$C$22
D23:G23D23=C23+$C$22
B24:G24B24=B$23/FACT(B$23)/(B$23-$B$19) * $B$19^B$23
B25:G25B25=SERIESSUM($B$19,0,1,1/(FACT(SEQUENCE(B$23,,0))))
B26:G26B26=B24/(B24+B25)
B29:G29B29=1-B26*EXP(-(B23-$B$19)*($B$8/$B$6))
B30:G30B30=$B$7
B31:G31B31=B29>=B30
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B31:G31Cell Value=TRUEtextNO
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I noticed the formula for Y is different from what I'm using,
You
Excel Formula:
=SERIESSUM($B$19,0,1,1/(FACT(SEQUENCE(B$23,,0))))
And if I were to show the LAMBDA function basic formula it would be
Excel Formula:
=SERIESSUM($B$19,0,1,1/(FACT(SEQUENCE(B$23+1,,0))))
By removing the +1, that may work for me
 
Upvote 0
UPDATE: I am still working on this but work pulled me to another project. I will return to this once that has completed.
 
Upvote 0
UPDATE: I am still working on this but work pulled me to another project. I will return to this once that has completed.
I am back on this project and will update with results and if so, resolved, when applicable.
 
Upvote 0
I revisited this some time ago and took a different approach altogether. I'll dig that up and provide some details.
 
Upvote 0
I revisited this some time ago and took a different approach altogether. I'll dig that up and provide some details.
KK, I'll be adding stuff here when I can. Look forward to seeing you approach to this.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,206
Members
452,618
Latest member
Tam84

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