• 506K Members
• 9,468 Online
• 603K Conversations

## Conditional Formatting on whole column with variable reference cells

Highlighted
Occasional Contributor

# Conditional Formatting on whole column with variable reference cells

Hi,

I'd like to format the colour fill of multiple cells within one particular column, when it's value is less than a cell in the row above of the next column. how should I do this please?

eg. when the value of D93 is smaller than the value of E92 format fill red. Apply to all D's.

So far I have established that if I type =(\$D\$93<\$E\$92) then I can make the rule work for cell D93. But how can I replicate this formula throughout the whole of the D column, without typing for each individual cell. Is this even possible? Is there a short cut to copying the rules over?

Thankyou

7 Replies

# Re: Conditional Formatting on whole column with variable reference cells

Remove the dollar signs and then Copy, Paste Formats down the range you need the format to be applied to .

# Re: Conditional Formatting on whole column with variable reference cells

Thanks @Riny_van_Eekelen

I've applied your suggestion and it has worked majoritably, however there are a few that are inaccurate, i.e. same value or higher value any ideas why this is please see attached photo:

Any ideas why this is happening, please?

Thankyou

# Re: Conditional Formatting on whole column with variable reference cells

Since you apply CF to entire column D, your formula shall be for the first cell of the range, other words for D1, otherwise the logic will be shifted. I'd suggest

``=\$D1<OFFSET(\$D1,-1,1)``

and

# Re: Conditional Formatting on whole column with variable reference cells

@Sergei Baklan Hmm, this seems to have complicated things slightly. I applied the example given to cell D5 "=\$D5<OFFSET(\$D5,-1,1)" and now the 1st cell is filled red.

This is understandable as E4 has letters not numbers, but it hasn't resolved the original problem. Infact it seems to have delivered a new one:

When I change the value (highlighted Yellow) to trigger the formatting it actually changes D3!?

Did I miss something?

# Re: Conditional Formatting on whole column with variable reference cells

First, in this variant we apply conditional formatting to entire column D, not to concrete cell or range.

To exclude headers we may modify rule formula as

``=(\$D1<OFFSET(\$D1,-1,1))*(ROW()>5)``

When it'll be like

# Re: Conditional Formatting on whole column with variable reference cells

@Sergei BaklanPERFECT! Thankyou so much, really appreciate the additional time spent on helping me clarify my oversight, Thanks!

# Re: Conditional Formatting on whole column with variable reference cells

@LazyBee , you are welcome

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
50 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
32 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
15 Replies
Discussion - Updating our interface with Fluent touches
Elliot Kirk in Discussions on
102 Replies