Conditional formatting based on column header

bpt

New Member
Joined
Sep 7, 2004
Messages
13
I have a number of columns and I want to colour them either Green or brown based on whether the text in A1:a10 is "Actual" or "Budget". Is there a formula that can apply to the whole cell range or do I need to do each column separately? I am using Excel 2007.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Did you mean A1:J1 for your headers?

You can apply a formula to the whole cell range; however you will probably need two rules (Budget, Actual). In this example the formulas are applied to the range B3:Z100 just to show you don't have to do all rows in the column.

Excel Workbook
ABCDE
1BudgetActualBudgetActual
2SalesSalesCostCost
3Jan-11149178178126
4Feb-11180176107125
5Mar-11116169143149
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B31. / Formula is =B$1="Budget"Abc
B32. / Formula is =B$1="Actual"Abc


Be careful to use B$1 and not $B$1 so that formulas will be relative to each column.
 
Last edited:
Upvote 0
Hello.

I am having the same problem, except I want to say.

IF HEADER="MSRP" THEN SET TO NUMBER (FORMAT).
The data itself changes, so the position it is in in the sheet changes. So I can't say, "Column F" or anything like that.

Steve
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

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