Forum Discussion
Happy holidays: a tree drawn in Excel cells with one formula
Happy holidays, everyone. Here's a small seasonal workbook for anyone who likes conditional formatting: a tree drawn in cells that lights up row by row.
How it works: every tree cell has the same formula. It returns 1 (lights off), 2 (green), or 3 and 4 (red and gold lights).
Home > Conditional Formatting has one "Cell Value equal to" rule per number with a fill colour, and the cells use the custom number format ;;; so the digits stay hidden.
I2 is the switch (Y or N) and I3 is a step from 0 to 24. Each step lights one more row from the top, the trunk comes on at 13 and the star at 14, and every step swaps the red and gold lights, so stepping through it looks like blinking.
The formula in every tree cell:
=IF(AND($I$2="Y",$I$3>=ROW()-4),IF(MOD((ROW()-4)*7+COLUMN()*3,5)=0,IF(MOD($I$3+ROW()+COLUMN(),2)=0,3,4),2),1)
ROW()-4 is the tree row, so a row lights once the step reaches it. MOD((ROW()-4)*7+COLUMN()*3,5)=0 picks about one cell in five as a light, and MOD($I$3+ROW()+COLUMN(),2) flips each light between red and gold on every step.
The workbook is attached, with no real data in it. I checked it in Google Sheets and another spreadsheet app rather than Excel itself, so let me know if anything looks off in your version.
(Drafted with AI assistance and checked before posting.)