# Assigning a Coloured Cell a Number

#### scottie_72

##### Board Regular
Hi There,

I wonder if it was possible to assign a specific number to coloured cells.

I'm trying to figure out something for a holiday camp where if the room number is coloured Yellow that mean that there will be 2 people in a room and if the cell is coloured Blue that there is 1 person in a room and Green means 3 people to a room.

Then use Excel to add out how many towels are needed in total for each cleaner?

is there a way of doing this?

Any help would be appreciated.

### Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

#### Taul

##### Well-known Member
You can use Conditional Formatting
Cell Value = 1 format as blue
Cell value = 2 format as yellow etc.

Last edited:

#### scottie_72

##### Board Regular
Hi Taul,

Sorry I should have explained a little better... on the sheet all the cells (That have the room numbers entered) have their interior coloured - I just was looking for something to total up all the Yellow/Blue & Green Cells to give me a total of what was needed.... I thought it might a simple thing when I started out!

#### scottie_72

##### Board Regular
Oooh That looks interesting... Thanks Taul Greatly appreciated

#### scottie_72

##### Board Regular
That works great - shame it can't update if the colour changes though...

#### Taul

##### Well-known Member
Are you changing the fill colour manually using the "Fill Color" from the ribbon?
You could add a column to type the number of people in the room and let conditional formatting change the colour for you, that may also assist in the second stage of counting the towels needed, assuming it was fixed qty of towels per person.

#### scottie_72

##### Board Regular
That sounds cool. At the moment I created a macro & button so that when the rooms are highlighted the button just needs to be clicked? How would you go about your idea? ( sorry for being thick!)

#### Taul

##### Well-known Member
The idea is to form columns :-
column A = Room number
Column B = Qty of people
column C = number of towels or whatever you want.

Column B - use "conditional Format" to change the cell background colour based on the cell value.
So that if the cell value is 1, format as blue
cell value = 2, format as yellow
cell value =3, format as green

So basically, you manually type the number of people in the room and the cell background changes colour automatically.
You can add the conditional formatting to column A as well, so the room number cell also changes.

you mentioned that you have a macro assigned to a button, but what does the macro do?

Replies
1
Views
469
Replies
1
Views
195
Replies
5
Views
131
Replies
3
Views
206
Replies
2
Views
564

1,190,781
Messages
5,982,873
Members
439,803
Latest member
sushilneupane

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back