SOLVED

Assign color to specific numbers

Brass Contributor

Hello all, 

I`m a new member in this forum and this is my first post here.

I use excel more and more in my day job and have discovered that excel is a very powerful tool with tons of functionality that can be used in various ways.

I try to learn as I go along within excel. 

 

No to my question this time:

How can I assign colors that I choice to specific numbers in excel? 

1 equals green, 2 equals blue etc... so every time a user press 1 in any cell within the specific sheet the background color will change according the color assigned to the specific number.

 

Hopes this makes sense, and that someone are able to help. 

Attached a very simple example file to help explain what I want to achieve. This is basically for my learning howto do it.

 

BR 

Niclas

6 Replies

Hi Niclas,

 

Welcome to Microsoft Excel Community!

 

There is a powerful tool in Excel called (Conditional Formatting), through this tool you can achieve what you asking for in the following steps:

  • Select the range (for example A1:B5) that you want to assign the colors to it.
  • Go to Home >> Styles >> Conditional Formatting >> Highlight Cells Rules >> Equal To.
  • In Equal To dialog box put the number and assign the color that you want to it, then click OK.
  • Do the same steps for each number.

 

I hope this helps you

Hello Haytham,

First of all, thanks alot for your help.

 

An additional thing tho.

Is it possible to achieve that the numbers actually disappears in the actual cell? So only the color is visible? 

Br

Niclas

best response confirmed by Niclas Johansson (Brass Contributor)
Solution

Hi Niclas,

 

You can do that with another technique along with the Conditional Formatting.

 

After you finish the previous steps and apply the colors to the numbers:

  • Select the range of numbers.
  • Click Ctrl+1 to open the Format Cells dialog box.
  • From the Number tab, select Custom category.
  • In the Type box, type double quotation mark twice "" and then hit OK.

 

Very good.
Thanks alot.
Works perfectly.

@Haytham Amairah 

Hi,

Unfortunately when i tried this more than 1 time the function is no longer available.

I tried it and it work more or less perfect, but just for the first time. 

Is it something that´s wrong with my excel or is it a setting?

Thanks fro your time

This doesn't help It only gives pre determined colors@Haytham Amairah 

1 best response

Accepted Solutions
best response confirmed by Niclas Johansson (Brass Contributor)
Solution

Hi Niclas,

 

You can do that with another technique along with the Conditional Formatting.

 

After you finish the previous steps and apply the colors to the numbers:

  • Select the range of numbers.
  • Click Ctrl+1 to open the Format Cells dialog box.
  • From the Number tab, select Custom category.
  • In the Type box, type double quotation mark twice "" and then hit OK.

 

View solution in original post