Simulate Christmas tree lights in Excel
Originally published: 14/12/2020 09:56
Publication number: ELQ-71146-1
View all versions & Certificate
certified

Simulate Christmas tree lights in Excel

Simulate Christmas tree lights in Excel

Description
It's Christmas time again, the season of cheer. You can bring a little festive merriness to your PC by simulating Christmas tree lights using the magic of random numbers combined with conditional formatting. Why not have a go yourself?

I will show you how to develop this in just 4 steps. No macros required!

Step 1 - Paint your tree
Make columns narrow, add background colours then add a star using the character map and the font Wingdings.
Paste into the cell above the tree, it looks like this «.
Then change the font, size and colour of the "star cell" so it looks like a star.

Step 2 - Add formulas
Enter this formula in all tree cells:
=RANDBETWEEN(1,3)
This generates a random number between 1 and 3 every time a calculation is performed.
We will use these numbers to set the colours of the lights.

Step 3 - Format
Select all tree cells and add conditional formatting.
Then "Manage Rules"...
If you also want to animate the star, add 3 conditional formats to the star cell as follows. Select the star cell, then Conditional Formatting, New Rule… Select "Use a formula…" and set the font colour based upon the value in a tree cell (say P8).
Repeat for the other two possible values with different font colours.
You can remove gridlines if you want a "cleaner" look for your sheet.

Step 4 - Animate
Press F9 to change the colours. Or press and hold F9 to animate.
Enjoy!

PS If you like this, try my other Christmas download with a snowfall simulation

This Best Practice includes
1 Excel file with 4 steps of instructions and screenshots and a functioning animation

Gary Knott offers you this Best Practice for free!

download for free

Add to bookmarks

Discuss

Further information

To show users how to use random numbers and conditional formatting to generate a fun simulation for Christmas

Users who want to (1) have fun with Excel, or (2) learn to use random numbers and conditional formatting

People without Excel


0.0 / 5 (0 votes)

please wait...