Running 100 Iterations of a Random Generator using a Formula

matthewlouis

Active Member
Joined
Mar 28, 2014
Messages
374
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Before I post the spreadsheet I have already built using the XL2BB posting process, I would like to know if what I want is even possible. The generator using 51 years of stock and bond market data and monthly inflation (CPI). A monthly income is deducted from the account balance, then the remaining funds get the historical random return. Then you start over in month 2, adjust the monthly income by the random CPI, deduct it from the Month 1 ending balance, add the monthly random return for month 2, and so on . . . Of course, I can hit F9 and it recalculates to show me the results. What I want to do run 100 iterations at one time and summarize each of the results in a table showing how many times the money ran out between age 60 and 70, 71-74, 75-79, 80-84, 85-89, 90-94, 95-100, and the last one is never run out.

I have never learned to code with VBA, strictly a formula guy. Is this even possible using formulas? If it is, I can upload the spreadsheet in XL2BB.

Thanks in advance!
 
Last edited:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
If you can set up your scenario with formulas, you can use Data Tables. See here:


Based on what you've said, you'd want to create a table with 480 rows (years 60-100 times 12 months). Put your starting amount in the first row. Set up the formula in each row to subtract out your monthly amount, then look up the return for that month and apply that to the remainder. Each successive row would use the previous row as a starting point. Then you'd set up another formula to find where the amount goes below 0. Then the data tables tool would run the formulas for various monthly amounts and compile a table.
 
Upvote 0
Fantastic! Yes, I have already set up the spreadsheet I just didn't how to run the 1000 simulations and compile. The video is very helpful! Thank you for the link, Eric W.!
 
Upvote 0
Eric, I reproduced the exact spreadsheet on the video. However, my sheet gets to the 1000 iterations forumula using the data table, I put in in, and I ponly get changes in the $$ in the Simulation Iteration column from Years 1 to 4. But starting year 5, it's the same number all the way to 1000. (?) Is there a setting in excel for iterations I need to change? I currently have 100 in the File > Options > Formulas > Iterations.

Thanks in advance!
 
Upvote 0
Got it, thanks!
And you marked your own comment post as the solution again. So I unmarked it, once again.

Let me explain. Post #2 and post #3 might have helped you. In that case, select one of those, the one which helped most.
Or, you might have found your own solution. If this is the case, then post your own solution and then mark that post.
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

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