Help with Running a formula within a formula for multiple individual results

%3CLINGO-SUB%20id%3D%22lingo-sub-2218804%22%20slang%3D%22en-US%22%3EHelp%20with%20Running%20a%20formula%20within%20a%20formula%20for%20multiple%20individual%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2218804%22%20slang%3D%22en-US%22%3E%3CP%3EOk%2C%20how%20best%20to%20explain%20my%20dilemma.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20program%20a%20simulation%20of%20multiple%20events%20based%20on%20a%20couple%20of%20factors.%20Bear%20with%20me%2C%20and%20my%20Excel%20file%20is%20protected%20information%20so%20I%20can't%20share%20it%20but%20will%20show%20the%20Formulas.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Base%20line%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(B226%3D1%2C(IF(%24N%24228%3D%24R%24223%2C%3CSTRONG%3E%24O%24229%3C%2FSTRONG%3E%2C%3C%2FP%3E%3CP%3EIF(%24B%24223%3D%24P%24228%2C%24Q%24228%2CIF(%24B%24223%3D%24P%24229%2C%24Q%24229%2CIF(%24B%24223%3D%24P%24230%2C%24Q%24230%2CIF(%24B%24223%3D%24P%24231%2C%24Q%24231))))))%2C%22%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Bold%20is%20the%20focus%2C%20referring%20to%20this%20simple%20reference%20line%20of%20code%3A%3C%2FP%3E%3CP%3E%3CSTRONG%3ERANDBETWEEN(1%2C20)%2BC223%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(C223%20refers%20to%20another%20variable%20number%20per%20a%20different%20factor%2C%20which%20doesn't%20impact%20my%20problem.)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20I%20have%20multiple%20instances%20(cells)%20of%20my%20baseline%2C%20but%20I%20can't%20figure%20(or%20know%20if%20it's%20possible)%20to%20have%20when%20the%20%3CSTRONG%3EIF(%24N%24228%3D%24R%24223%2C%24O%24229%3C%2FSTRONG%3E%20is%20True%2C%20to%20run%20that%20reference%20formula%20in%20that%20cell%20as%20the%20result.%20As%20it%20is%20now%2C%20it%20will%20return%20with%20the%20formula%20itself%20%22RANDBETWEEN(1%2C20)%2BC223%22%20as%20the%20answer%20instead%20of%20running%20the%20formula.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can't%20use%20the%20%3D%20in%20front%20of%20the%20formula%20in%20the%20reference%20cell%2C%20because%20then%20it%20will%20run%20that%20formula%2C%20which%20is%20no%20good%2C%20because%20then%20all%20my%20instances%20will%20come%20back%20with%20the%20same%20result%2C%20when%20I%20need%20each%20instance%20to%20solve%20with%20its%20own%20random%20number.%20I%20tried%20a%20couple%20of%20things%2C%20but%20am%20failing%20to%20resolve%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20help%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2218804%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2219378%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Running%20a%20formula%20within%20a%20formula%20for%20multiple%20individual%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2219378%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F294485%22%20target%3D%22_blank%22%3E%40CADDmanDH%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECan't%20you%20use%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DIF(B226%3D1%2C(IF(%24N%24228%3D%24R%24223%2C%3CSTRONG%3ERANDBETWEEN(1%2C20)%2B%24C%24223%3C%2FSTRONG%3E%2C%3C%2FP%3E%0A%3CP%3EIF(%24B%24223%3D%24P%24228%2C%24Q%24228%2CIF(%24B%24223%3D%24P%24229%2C%24Q%24229%2CIF(%24B%24223%3D%24P%24230%2C%24Q%24230%2CIF(%24B%24223%3D%24P%24231%2C%24Q%24231))))))%2C%22%22)%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Ok, how best to explain my dilemma.

 

I am trying to program a simulation of multiple events based on a couple of factors. Bear with me, and my Excel file is protected information so I can't share it but will show the Formulas.

 

The Base line: 

=IF(B226=1,(IF($N$228=$R$223,$O$229,

IF($B$223=$P$228,$Q$228,IF($B$223=$P$229,$Q$229,IF($B$223=$P$230,$Q$230,IF($B$223=$P$231,$Q$231)))))),"")

 

The Bold is the focus, referring to this simple reference line of code:

RANDBETWEEN(1,20)+C223         

 

(C223 refers to another variable number per a different factor, which doesn't impact my problem.)

 

So, I have multiple instances (cells) of my baseline, but I can't figure (or know if it's possible) to have when the IF($N$228=$R$223,$O$229 is True, to run that reference formula in that cell as the result. As it is now, it will return with the formula itself "RANDBETWEEN(1,20)+C223" as the answer instead of running the formula.

 

I can't use the "=" in front of the formula in the reference cell, because then it will solve that formula there (once), which is no good, because then all my instances will come back with the same result, when I need each instance to solve with its own random number. I tried a couple of things, but am failing to resolve this.

 

All help appreciated.

 

1 Reply

@CADDmanDH 

Can't you use

 

=IF(B226=1,(IF($N$228=$R$223,RANDBETWEEN(1,20)+$C$223,

IF($B$223=$P$228,$Q$228,IF($B$223=$P$229,$Q$229,IF($B$223=$P$230,$Q$230,IF($B$223=$P$231,$Q$231)))))),"")