Example: Calculate Pi (3.1415926) in Microsoft Excel
You are wondering what is Pi and how it is calculated. Find out here.
Pi is the ratio of a circle and the square that surrounds this circle.
The area of a square is
Side x Side = Area
The Area of a circle is
PI x r^2
r being the radius.
As the radius is equal to half the Side of the square. The area of the circle can be rewritten to
1/4 x Pi x Side^2
So the ration of the circle to the square is Pi/4.
Lets try this with Excel.
Look at the following screenshot and download the spreadsheet.
Beware the sheet has 1600 lines so it is quite big.
and this is the Graph
You can see in blue the items in the circle and in red the items outside.
The ratio of Blue / (Blue+Red) = Pi/4
Here the value of Pi to a few hundreds digits....of course this example will not allow you this but one thing it will let you know
is if your random (RAND) number generator is of good quality. If it is, the value of PI should be approached quite fast. If not, then
the RAND generator cannot be trusted fully.
You can download this example here.
and in older Excel format here.