Forum Discussion
Copying Conditional formatting with relative cell referencces in the formula desn't work
I tried using =D15>(BUDGET!D15*1.05) too. It copies the D15 cell reference as the test, instead of changing relatively.
That is correct behavior, you may check on the sample. Let for such sample
we apply CF rule as in your post only the the cell D15 and as the next step apply by Format Painter to all other cells in our ranges. Rule formula will be
It is still D15 in rule formula but that's what we need. Engine scans Applies to ranges one by one cell and apply rule formula same way as if you drag D15 cell here. Other words , for F15 formula works as =F15>Budget!F15; for F16 as =F16>Budget!F16, etc.
If we change initial formula on =D15>Budget!$D$15*1.05 we always will be compare with Budget!$D$15, e.g. on next range F15 will be cvompared as =F15>Budget!$D$15.
Of course, if do not "paint" by Format Painter but double click on it and navigate with that through range cells, we will generate a lot of new rules with "correct"cell references
- SergeiBaklanFeb 01, 2024Diamond Contributor
Carsten2900 , you are welcome.
That's quite old discussion, not sure which exactly formula do you mean. In general conditional formatting rule formula iterates cells in the range, to which the rule is applied, the same way as the same formula in the grid (outside your range) which you is entered against first cell of the range and after that dragged right and down.
- Carsten2900Jan 23, 2024Copper Contributor
SergeiBaklan I don't get the logic in this rule, but it works fine and solved an issue regarding formatting cells with relative reference! Thanks!
- BoWanNov 14, 2022Copper ContributorHi,
After hours of testing, something finally worked, and at least for me it vas simpler than I imagined. I'm quite sure I tested the solution many times before to no avail, but suddenly, and repeatedly it worked:
1) Create the conditional formula in one cell, which in my case was a simple "Make red if value in this cell (A2) is larger than in the adjacent cell (B2)". In the edit formula which now refers to cell $B$2, press F4 repeatedly until you have only relative references, i e without any '$' before row or column. (If you know what you are doing you could have a mix of absolute column and relative row, or vice versa, but everything relative without ANY '$' seemed safest for me)
2) Select the cell with the formula, then click the format painter.
3) Click the first cell in the range where you want a copy of the formula, drag over the rest of the range, then release the mouse button.
It seemed to me as every cell with the same conditional format then looked relative for its comparison.
I have edited the $B$2 reference manually several times, but with varying success. Using F4 repeatedly seemed to have some magick (don't understand why) and suddenly it worked. - HBNov 13, 2022Copper Contributor
Dear, thanks for taking your time to exactly trace out the errors in the formula. This formula actually works as planned but the relative reference doesn't change the cell reference by copying down our recipe. I think there is a glitch which we aren't able to catch, due to which this happens. 😉
If at any time you're able to achieve the same with relative reference changing on the given cell, Kindly share the same.
Thanks once again.
- BoWanNov 13, 2022Copper Contributor
Hi, thanks for your advice, but it does NOT work. I have followed your instructions exactly, but NO new rules are created when I step through all cellls in the range with the mouse button. There is only the original rule, but the "Applied to" is just expanded and refers to the same compared cell as in the first rule.
- MorisnOct 01, 2022Copper ContributorBonjour Hamad!
Simply Awesome.
You did it.
BIG THANK YOU! - HBSep 27, 2022Copper Contributor
Hi, Bonjour!
Dear Oscar,
Hope your are doing well, as I opened my outlook today, read your e-mail concern and quickly started to trial the formula that you have put forward. As I had similar concern last year and got some help here and some formula just worked, just by changing values here and there.
So here is your formula that you need to modify a little bit to get what you need to do in M.S Excel.
Formula: =NOT(ISBLANK($A2)) Format: Amber Applies to: =$B$2:$F$2,$B$2:$F$300
The difference here is that we are applying formula to cell reference only and format to whole table array.
This formula does the intended work as a result.
Just apply conditional formatting to one of the cell and copy that cell up to ranges you're applying to.
Here is the formula snapshot.
https://paste.pics/IU8M3
Hope this works for you and get the most out of M.S Excel.
Thanks & Regards
Hamad B
- MorisnSep 27, 2022Copper Contributor
Hello there,
Since I don't know if this thread is still alive, I'll be very brief. I am having a similar problem with formatting but what I want to achieve is the following:
Simply, every time that I enter 'Y' on Column A, I want the entire row to change colour. As simple as that.
Actually, I don't even care if it's Y or Nay, as long as that row changes colour when it's not blank. Since I am not allowed to add images in this thread, I am sending the Gyazo link where I captured the examples I want to show.
But first, the formula.
I created a rule first, for row no. 2 as follows:
Formula: =NOT(ISBLANK($A$2)) Format: Amber Applies to: =$B$2:$E$2
When trying to figure out how to replicate, the only way I was able to do it the way I wanted was to duplicate the formula and change its values manually.
I did that 6 times before I got tired.
The rows I added and modified can be seen here:
https://gyazo.com/2fbd83b871a38ddccba5f01f044362e9
And a sample of the results:
First date row (2) with a 'Y' changes row no. 2 colour to amber:
https://gyazo.com/1c8fce73dee70e8397c6ec161406d6ca
And another one:
https://gyazo.com/23e82b0e0bdd83e82dbde7dceee2edcf
Now, for a few rows, it's doable; however, this is completely impractical and backwards for software such as Excel to be doing this for any number of rows. So there should be a better way to do this.
I have about 300 records to apply this to and may be more.
Hopefully, someone could give me an idea of how to go about this.
Thank you and regards,
Oscar - SergeiBaklanSep 26, 2021Diamond Contributor
You don't need absolute reference on rows in the formula, only on column. With that row will be filled correctly and may correctly apply conditional formatting rules to other rows by format painter or so.
=SEARCH( "previous", $S5)not $S$5
- Matthew500Sep 22, 2021Copper Contributor
I'm trying to copy conditional formatting that colors every single row depending on the value they have in a certain cell. For some reason I must use $$ in the "Rule" section/formula for the row to be completely colored within the row range, otherwise it only colors the first cell of the range.
Do you know how can I setup this so when I copy the conditional formatting the value goes up accordingly to the row I'm copying? The "Applies to" sections bumps up automatically in that case, but the "Rule" formula section doesn't.
Thanks!
- SergeiBaklanMay 25, 2021Diamond Contributor
HB , glad it helped, thank you for the feedback
- HBMay 24, 2021Copper Contributor
Thanks SergeiBaklan
I have read the information through and I find it useful, because I had to also conditional formatting on series of infinite cells. I tried the formulas mentioned in this conversation and after few trials it worked! 🙂
I don't understand exactly how it works but it does what I want.
Thanks again.
- SergeiBaklanMay 10, 2021Diamond Contributor
Rule formula could be like =$B2<>$C2 applied to entire range as B2:C999.
With sample file which shows the same data as on screenshot it'll be easier to demonstrate.
- StevanMuller12May 10, 2021Copper Contributor
Good Day,
We are trying to show the difference in price change of 2 lists of sku and prices.
And original conditional formatting does not have a rule for this help will be much appreciated. - SergeiBaklanFeb 12, 2021Diamond Contributor
Jbetteridge91435 , glad to help
- Jbetteridge91435Feb 11, 2021Copper Contributor
SergeiBaklanThankyou very much. this has saved me sooooo much time!! your the real MVP!!
- SergeiBaklanOct 01, 2020Diamond Contributor
Yes, but first one could have side effect in some situations
- AaronWalkerOct 01, 2020Copper Contributor
Yes, looks like both methods will work provided that the first row of data is selected in the current section. All good! Thanks for sharing.
- SergeiBaklanOct 01, 2020Diamond Contributor
- AaronWalkerOct 01, 2020Copper Contributor
What you are showing in your reply will not work. However, the format I presented works for me in my workbook which was attached. Since I am new to this, I am not sure you see it. Anyway, good luck.
- SergeiBaklanOct 01, 2020Diamond Contributor
- AaronWalkerSep 30, 2020Copper Contributor
BUDGET - C ACTUAL - D 454 454 258 258 159 155 357 357 654 654 Two Rules: formulas
=D11:D15<>C11:C15 Red
=D11:D15=C11:C15 Green
Applies to: =D11:D15<>C11:C15 same in both rules
- SergeiBaklanJul 11, 2020Diamond Contributor
Perhaps you may submit sample file removing all extra and sensitive information
- varocketryJul 11, 2020Copper Contributor
I'll try that. I am completely unaware the " " is required. Nor do I understand their operation.
But, I'll try it. Thanks again.