Conditional Formatting

mclambchop

New Member
Joined
Apr 29, 2014
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a spreadsheet with two columns, one has an area name in and the second column has the branch name. Some areas could have 5 branches and some could have 15 branches. I would like to format each row based on the area name. So if its area 1 then say a light grey, if area 2 then a light blue, if area 3 revert back to a light grey, area 4 revert back to light blue and so on.

Does anyone have any idea on the best way to do this?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
"So if its area 1 then say a light grey, if area 2 then a light blue, if area 3 revert back to a light grey, area 4 revert back to light blue and so on."

You are implying you are only ever going to use 2 colours and that the colour is dependent on whether the area is an odd or even number.

So just use two formulas in the CF

=MOD(A1,2)=0
and
=MOD(A1,2)=1

to distinguish between odd and even numbers
where A1 is the area number.
 
Last edited:
Upvote 0
The areas actually have names, certain parts of the country so are text fields. I only need to use two colours, its just to help visually see the difference where one area stops and another starts, just to help focus the user with lots of data being shown
 
Upvote 0
Only way I can think of is to create a table of of area names and numbers 1 or 2
Perform a lookup based on the name and the 1 or 2 will indicate which colour.
 
Upvote 0
Maybe something like
=AND($A2<>"",MOD(SUMPRODUCT(--($A$1:$A1<>$A$2:$A2)),2))
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top