Highlight Winning Lottery Numbers in Excel

Excel Knows If You Won the Lottery

Apparently you have to buy a ticket if you want to win the lottery, so I’m out of luck. However, if you’re in an office lottery pool, or buy your own tickets for the lottery, Excel can let you know if you have a winning ticket.

Excel Knows If You Won the Lottery

Yes, Excel knows if you won the lottery — it just takes a bit of conditional formatting, and the COUNTIF function.

Highlight Winning Lottery Numbers in Excel
Highlight Winning Lottery Numbers in Excel

Highlight Other Things

You could use this technique to highlight other things too, based on a list of items to check.

For example, you could create a list of bad accounts or obsolete products, and highlight those on an Excel worksheet with product order requests.

Highlight Lottery Numbers

In this example the ticket numbers are in cells B2:G4, and the winning numbers drawn for the current lottery are entered in cells B6:G6.

Follow these steps to highlight the winning numbers in the list of tickets:

  1. Select the cells were the conditional formatting will be applied, B2:G4
  2. On the Excel Ribbon’s Home tab, click Conditional Formatting
  3. Click New Rule
  4. In the New Formatting Rule window, click Use a Formula to determine which cells to format
  5. For the formula, use the COUNTIF function, and refer to the active cell:
    =COUNTIF($B$6:$G$6,B2)
  6. Click the Format button.
  7. Select the formatting options that you want (blue fill colour, in this example), then click OK.
  8. Click OK
New Formatting Rule window
New Formatting Rule window

Winning Numbers Are Highlighted

After you click OK, to apply the conditional formatting, the cells with winning numbers are highlighted in blue, and other cells have no fill colour.

There are more examples of Excel conditional formatting on my main Contextures website.

CondFormatLottery00

Watch the Video

To see the steps for highlighting the winning lottery numbers with Excel conditional formatting, watch this short Excel tutorial video. There’s no guarantee that this will improve your odds of winning, but at least you’ll know if you do!

______________________

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.