Simulating an Event Happening by Using Excel

Home / Excel / 300 level / Simulating an Event Happening by Using Excel

TRUE AND TRUE Isn’t Always TRUE

From a Boolean perspective, of course TRUE AND TRUE = TRUE. However, sometimes you may want to model something in a simple manner that may be much more complex then a couple of inputs.

For example, imagine you wanted to simulate whether it was going to snow on a given day. Perhaps you have one value that identifies whether it is cloudy or not. In another value you have identified whether it is freezing cold outside.

If CLOUDY = TRUE, and FREEZING = TRUE, you still can’t say SNOW = TRUE. The final factor may be whether or not there will be any precipitation on that day. Lets say there was a 60% chance of precipitation. The chance of snow would then be 60% on a day where it was cloudy and freezing. If either cloudy or freezing weren’t true, it wouldn’t snow.

You can set up a table with a column for each variable, or you can use the pwrMAYBE function. In the example above the pwrMAYBE function could be used as follows.

=pwrMAYBE(TRUE, TRUE, 60)

To randomize whether it was cloudy or freezing, you could write as follows.

=pwrMAYBE(pwrRANDFROMSET(TRUE(), FALSE()), pwrRANDFROMSET(TRUE(), FALSE()), 60)

If this formula was repeated over a number of cells the result would be the number of days with snow with a 60% chance of precip on days where there was an equal chance of being cloudy and freezing. It’s a super simple example but it gives you an idea of the usage of pwrMAYBE.