Condtional format based on the value of another cell

iksotof
3StarLounger
Posts: 315
Joined: 04 May 2010, 15:18

Condtional format based on the value of another cell

Post by iksotof »

Hello

I have a column of title labels with sub labels in the cells underneath. For example Cell A2 would be title label and A3 and A4 sub labels. This is a long list and will change from time to time so for example next week A2 would still be the header but the content could change to show A3, A4 and A5 as sub labels. What I am requiring is for a way of keeping my title labels a different colour to the rest. This is a copy and paste exercise from another source, I was thinking of conditional formatting based on a numeric value I could put into a another cell. For example if cell C3 was 1 then have A3 (the header) one colour else if no value in C3 then another colour. I'm not certain how to do this in the conditional formatting tool and would also like it to run down the length of the table, again I'm not certain how to do this (like one can in a standard formula and click to run down). Assuming this makes sense can anyone give me any pointers or indeed a suggest a more efficient way of doing this?


Thanks

User avatar
HansV
Administrator
Posts: 78568
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Condtional format based on the value of another cell

Post by HansV »

You could do the following:
- Select A3:A10 (or however far down the sublabels could potentially go).
- A3 should be the active cell within the selection.
- Set the formatting to what you want it to be if the cells are NOT subheaders - presumably the standard formatting.
- On the Home tab of the ribbon, select Conditional Formatting > New Rule...
- Select 'Use a formula to determine which cells to format'.
- Enter the formula =$C3=1
- Click Format...
- Specify the formatting you want the cells to have if they are subheaders.
- Click OK, then click OK again.
Best wishes,
Hans

iksotof
3StarLounger
Posts: 315
Joined: 04 May 2010, 15:18

Re: Condtional format based on the value of another cell

Post by iksotof »

Han's that's fantastic.

Thank you v m