28 March 2012

Somewhat Object-Oriented Excel

One of the good things about Excel/VBA is that VBA supports classes and object-oriented designs.

The bad thing is that the objects and methods aren't accessible with worksheet cell formulas. That means that if you define a class module, you still need an ordinary module for the functions that will provide an interface between the spreadsheet and the class.

20 March 2012

Monty Hall Simulation

Not to be confused with Monte Carlo Simulation, this is about the so-called "Monty Hall Paradox."

In the Monty Hall game, there are three doors, one of which hides a prize. The contestant chooses one of the doors, at which time Monty opens another door with no prize behind it. Now the contestant is given an option to switch doors. The question is, "Should the contestant switch or not, or does it matter?"

07 March 2012

How to do a proper histogram in Excel

A few months ago I posted an article on the right way to do a histogram. The example I showed was done with JavaScript, because there was no way apparent to do it in Excel.

I found this annoying, so I've been picking away at it. The problem is that the labels should be between the bars, not underneath them, and Excel insists on putting them underneath.