Monte Carlo Simulations in Excel with Python

Published: 02 April 2024
on channel: PyXLL - Write Excel Add-Ins with Python and Java
2,905
63

Monte Carlo style simulations in Excel using Python and PyXLL

All the code accompanying this video can be found here
https://github.com/pyxll/pyxll-exampl...

Learn how we can use Monte Carlo to calculate estimates to Excel models by using random distributions as input variables.

Python is used to generate random numbers from different distributions (the 3 point PERT distribution is used in this video) and the result of an Excel formula is collected for many samples of input variables using those distributions.

The input distributions and the sampled output distribution are displayed in Excel using the Python plotting package seaborn.

00:00 - Intro
00:36 - Example use case
01:17 - PyXLL
01:35 - Background explaination
02:11 - Writing a Python Excel macro
02:33 - The three point 'PERT' distribution
03:52 - Running the macro in Excel
04:18 - Writing the main Python code
06:08 - Plotting the input distributions
07:38 - The Monte Carlo simulation
12:40 - Improving the performance
15:41 - Extracting and plotting the results
17:46 - Making it reusable
18:58 - Wrapping up

Resources
========

PyXLL: https://www.pyxll.com
Source code: https://github.com/pyxll/pyxll-exampl...
pertdist: https://pypi.org/project/pertdist/
seaborn: https://seaborn.pydata.org/


On this page of the site you can watch the video online Monte Carlo Simulations in Excel with Python with a duration of hours minute second in good quality, which was uploaded by the user PyXLL - Write Excel Add-Ins with Python and Java 02 April 2024, share the link with friends and acquaintances, this video has already been watched 2,905 times on youtube and it was liked by 63 viewers. Enjoy your viewing!