Search Not Just Numbers

Tuesday 13 May 2014

Excel Tip - Adding a conditional Thumbs Up or Thumbs Down

This week, I want to show you a neat little trick for doing something a little more visually interesting than just using brackets to distinguish between positive and negative variances.

In this post, I will show you how to automatically show a green thumbs up or a red thumbs down next to the variance (depending on whether it is good or bad).

Once you know how to do this you can replace these with arrows or some other symbols and make the colours whatever you want them to be.

OK. Say we have an actual figure in cell A1 and a comparison in cell B1. A1 might be this month's sales, for example, and B1 might be budgeted sales, or last month's sales. Either way, we want to make it obvious at a glance that A1 being higher than B1 is a good thing, and A1 being less than B1 is a bad thing.

A green thumbs up, or a red thumbs down, in cell C1, should make this pretty clear - so how do we do it?

First of all, where do we get the Thumbs Up and Thumbs Down symbols from?

We can discover what symbols are available in different fonts by selecting Symbol from the Insert ribbon (this is on the far right of the standard Insert ribbon).

If we select the Wingdings font from the drop-down at the top, you can see there is a Thumbs Up symbol there. Click on it and note the number at the bottom left after the name of the font. In this case it says "Wingdings: 67", so the number to note is 67. This is the character code of this symbol. Click on the Thumbs Down and you will see that this has a character code of 68.


OK, now cancel this screen, as we are going to insert these symbols in a different way - now we know what we want.

We can refer to any character by its character code using the CHAR function. So, if in any particular cell, we change the font to Wingdings (either by right-clicking and using the format cells dialog box, or by selecting the Wingdings font from the drop-down on the Home ribbon),

=CHAR(67)

will return the Thumbs Up symbol.

For our purposes, set the font in cell C1 to Wingdings and type the following formula into cell C1,

=IF(A1>=B1,CHAR(67),CHAR(68))

This formula will return the Thumbs Up character if A1 is greater than or equal to B1, and the Thumbs Down character, if it is not.

If you need a refresher on the IF function, take a look at this earlier post.

All we need to do now is change its colour. We can do this using Conditional Formatting.

First of all, change the font colour in cell C1 to green (again, either from th Home ribbon or Format Cells).

We then want this to change to red if C1 contains a Thumbs Down.

Click on cell C1 and from the Home ribbon, click Conditional Formatting, New Rule, Use a formula to determine which cells to format (this step is covered in more detail in this earlier post).

In the formula box, enter:

=C1=CHAR(68)

and click on the Format button to change the font colour to red.

That's it. Change the values in A1 an B1 and you will see C1 change from a green Thumbs Up to a red Thumbs Down, depending on whether A1 is greater or less than B1!

As I said earlier in the post, you could use other symbols, such as up and down arrows and other colours, depending on your requirements. Have fun with it!

Excel Expert Course

If you enjoyed this post, go to the top of the blog, where you can subscribe for regular updates and get two freebies "The 5 Excel features that you NEED to know" and "30 Chants for Better Charts".

10 comments:

  1. Trouble is that to get a reasonable image size a minimum of 18 points must be used which often does not fit the available space/layout of an existing report!

    ReplyDelete
    Replies
    1. You're right. I had that issue too. I guess it's about getting the right image and font size for what you want.

      Delete
  2. Can't get it to work with a True/False cell.
    I would like all Falses to be filled red. The true/false is determined by a formula =A1=sum(A3:A5). This is for a long list, cells B1:B100

    ReplyDelete
    Replies
    1. If I've understood you correctly, you can use conditional formatting to fill the FALSE cells in red, by selecting Conditional Formatting, Format only cells that contain

      Cell value equal to FALSE

      Delete
    2. nice, thanks, it works now! Great tip.

      Delete
  3. Would love the instructions to have it a drop down selection in a column and adding the thumbs sideways symbol as well.

    ReplyDelete
  4. Not able to see the character (thumbs up/down ) on the excel instead showing "C" and "D", is there any setting need to be changed to see the needed characters? please suggest. thanks

    ReplyDelete
  5. You haven't set the font for the cell to Wingdings

    ReplyDelete
  6. There is no such font in excel how can i get it

    ReplyDelete
    Replies
    1. It would appear that there are some problems with the Wingdings font in the online Excel 365:

      Excel online issues

      Also, things may be different on a Mac:

      Mac issues

      Delete