If Statement Monte Carlo Simulation

%3CLINGO-SUB%20id%3D%22lingo-sub-3239653%22%20slang%3D%22en-US%22%3EIf%20Statement%20Monte%20Carlo%20Simulation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3239653%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20creating%20a%20Monte%20Carlo%20Simulation%20with%20multiple%20servers%3A%3C%2FP%3E%3CP%3ETo%20choose%20a%20server%2C%20a%20customer%20is%20redirected%20to%20a%20server%20that%20finishes%20first%2C%20or%20has%20the%20lowest%20end%20time%20as%20seen%20in%20columns%20G%2C%20J%20and%20M.%3C%2FP%3E%3CP%3EIf%20this%20was%20a%20two-server%20problem%20this%20would%20evaluate%20to%3A%3C%2FP%3E%3CP%3E%3DIf(MAX(G%245%3AG5)%3CMAX%3E%3C%2FMAX%3E%3C%2FP%3E%3CP%3EGiven%20this%20is%20a%20three%20server%20problem%20I%20initially%20used%20an%20Ifs%20statement%3A%3C%2FP%3E%3CP%3E%3DIFS(AND(MAX(G%245%3AG5)%3CMAX%3E%3C%2FMAX%3E%3C%2FP%3E%3CP%3EWhere%20this%20leads%20to%20everything%20evaluating%20to%20FALSE%2C%20to%20fix%20this%20I%20then%20changed%20it%20as%20follows%3A%3C%2FP%3E%3CP%3E%3DIFS(AND(MAX(G%245%3AG5)%3CMAX%3E%3C%2FMAX%3E%3C%2FP%3E%3CP%3EWhich%20all%20routes%20the%20customers%20to%20server%203%2C%20which%20means%20the%20last%20statement%20is%20always%20True.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20I%20can%20make%20this%20work%3F%2C%20I%20am%20trying%20to%20avoid%20using%20a%20'%26lt%3B%3D'%20because%20then%20it%20would%20prioritize%20the%20first%20server%20because%20it%20would%20be%20the%20first%20TRUE%20result%20in%20the%20IF%20statement.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Monte%20Carlo%20Multiple%20Servers%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F352286iAD8D9676730BB297%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Monte%20Carlo%20Snip.PNG%22%20alt%3D%22Monte%20Carlo%20Multiple%20Servers%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EMonte%20Carlo%20Multiple%20Servers%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3239653%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

Hi All,

 

I am creating a Monte Carlo Simulation with multiple servers:

To choose a server, a customer is redirected to a server that finishes first, or has the lowest end time as seen in columns G, J and M.

If this was a two-server problem this would evaluate to:

=If(MAX(G$5:G5)<MAX(J$5:J5),1,2) 

Given this is a three server problem I initially used an Ifs statement:

=IFS(AND(MAX(G$5:G5)<MAX(J$5:J5),MAX(G$5:G5)<MAX(M$5:M5)),1,AND(MAX(J$5:J5)<MAX(G$5:G5),MAX(J$5:J5)<MAX(M$5:M5)),2,AND(MAX(M$5:M5)<MAX(J$5:J5),MAX(M$5:M5)<MAX(G$5:G5)),3)

Where this leads to everything evaluating to FALSE, to fix this I then changed it as follows:

=IFS(AND(MAX(G$5:G5)<MAX(J$5:J5),MAX(G$5:G5)<MAX(M$5:M5)),1,AND(MAX(J$5:J5)<MAX(G$5:G5),MAX(J$5:J5)<MAX(M$5:M5)),2,TRUE,3)

Which all routes the customers to server 3, which means the last statement is always True.

 

Is there any way I can make this work?, I am trying to avoid using a '<=' because then it would prioritize the first server because it would be the first TRUE result in the IF statement.

 

Monte Carlo Multiple ServersMonte Carlo Multiple Servers

0 Replies