+ Reply to Thread
Results 1 to 18 of 18

Google Sheets,, how to copy conditional formatting and update cell references?

  1. #1
    Registered User
    Join Date
    05-16-2023
    Location
    UK
    MS-Off Ver
    Prof 2019
    Posts
    11

    Google Sheets,, how to copy conditional formatting and update cell references?

    I solved my earlier problem with conditional formatting but have bumped into another one: when I copy the conditional formatting to other cells the cell references in the custom formula don't update.
    The rules I'm using in cell C7 are:

    =NOT(isblank(C$3))
    =((C7="y")+(C7="n"))

    Is there any way to copy or apply these to other cells and have the references update?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    I don't use Google Sheets, but in Excel you can set the range for application of the rule in the rule itself. Maybe you can in GS, too. It's more reliable than copying and pasting, as long as you get your absolute and relative references correct. Out of context, it's hard to say with just a rule and no worksheet.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-16-2023
    Location
    UK
    MS-Off Ver
    Prof 2019
    Posts
    11

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    Sorry, I should have said that I've tried applying the rule to a range. It applies the rule but the cell references remain static.

    As an example: what I need is for:

    =NOT(isblank(C$3))
    =((C7="y")+(C7="n"))

    to be updated to:

    =NOT(isblank(D$3))
    =((D8="y")+(D8="n"))

    ... when the formatting is copied from C7 to D8. Once this works I can apply it to the whole sheet that I want to develop.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    Provide a link to a sample workbook.

  5. #5
    Registered User
    Join Date
    05-16-2023
    Location
    UK
    MS-Off Ver
    Prof 2019
    Posts
    11

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    As a newbie I'm not allowed to post links or images, and it seems I can't post attachments either.

    Updated to say that I've sent the google sheet to myself and then attached it here ...
    Attached Files Attached Files
    Last edited by Newbie53; 05-17-2023 at 11:03 AM. Reason: Correction

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    Post a link with TWO spaces in it. I will then FIX the link in your post for you.

    It's better to see it on Google.

  7. #7
    Registered User
    Join Date
    05-16-2023
    Location
    UK
    MS-Off Ver
    Prof 2019
    Posts
    11

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    Maybe this will work ... remove the socks and replace the colon

    https://docs.google.com/spreadsheets...it?usp=sharing

    Edited to add: it did work!
    Last edited by AliGW; 05-17-2023 at 02:07 PM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    Well, I’m sorry, but I askskedyou to put two spaces in it - nothing else. Unfortunately, therefore, I’ve been unable to fix it for you, so it’s if no use.

    Please try again. Do not change the URL - just add two spaces to it.
    Last edited by AliGW; 05-17-2023 at 01:14 PM.

  9. #9
    Registered User
    Join Date
    05-16-2023
    Location
    UK
    MS-Off Ver
    Prof 2019
    Posts
    11

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    I realise that you're trying to help, but deleting the pair of _socks_ and adding a colon should have been simple.


    You said "Do not change the URL - just add two spaces to it" - I tried adding two spaces at various locations (including at the end) but the system always refuses to accept the post and tells me that I am not allowed to add links.
    Please can you be specific about where to put the two spaces.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    I think the link is working now.

  11. #11
    Registered User
    Join Date
    05-16-2023
    Location
    UK
    MS-Off Ver
    Prof 2019
    Posts
    11

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    Thanks!
    Any suggestions on how to solve the problem?

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    I've had a look and I can see only two cells with letters in them in C and nothing in D. I am afraid I don't understand what you are trying to do.

    Explain in WORDS what you want the rules to do and which cells they need applying to.

  13. #13
    Registered User
    Join Date
    05-16-2023
    Location
    UK
    MS-Off Ver
    Prof 2019
    Posts
    11

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    I want to be able to copy conditional formatting (that includes a custom formula) and to have the cell references within that formatting to be updated.
    In other words the references within the conditional formatting rules need to be interpreted as relative references.

    The desired function is for a cell to change colour when anything is entered into a second cell and for the first cell to revert to its original (white) colour if a Y or an N are entered into it.
    The rules at the start of this discussion work as desired but I want to apply them to most of a worksheet so need the references to update.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    The desired function is for a cell to change colour when anything is entered into a second cell and for the first cell to revert to its original (white) colour if a Y or an N are entered into it.
    You seem to have two separate rules. For this to work correctly, the rule would need to be rolled into one, I think.

    I can't see where you have tried to copy the rule, nor can I see your having applied the rule to a range - just one cell.

    Can you provide details of exactly where you want the rule copying and what the cells will or might contain so that I can check your findings? I am not clear which of the formula cells need to be relative: C$3 is column relative and row absolute, whereas C7 is completely relative. I am still not completely clear on the issue - sorry. You have to understand that whilst this is all completely obvious to you, it may not be to others who are trying to help.

  15. #15
    Registered User
    Join Date
    05-16-2023
    Location
    UK
    MS-Off Ver
    Prof 2019
    Posts
    11

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    When I asked a couple of days ago (I'm not allowed to post the link) I was told by another admin (6stringjazzer) that I could not combine the rules.
    The rules as described provide the desired function but the references do not update when the conditional format is pasted into another cell.

    When copying any conditional format which contains a custom formula to another cell you will see that the cell references do not change, despite not being marked as static references.
    I can't explain this any more simply so try pasting a conditional format custom formula (say =isblank(A1)) into any cell (say A2), then copy it and past the conditional formatting into another cell (say B3) ... the cell reference in the custom formula will not have changed.
    It's this that I'm trying to find a way around so that I can apply the conditional format to a large number of cells without having to manually alter all the cell references.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    You are allowed to post links now as you have made 10 posts.

    I'm sorry - I can't help any further. I don't use Google Sheets, so don't know enough about its conditional formatting function. I am pretty good with Excel's, but if you can't combine rules in GS then I am afraid I'm stumped. Hopefully someone esle will know.

  17. #17
    Registered User
    Join Date
    05-16-2023
    Location
    UK
    MS-Off Ver
    Prof 2019
    Posts
    11

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    Thanks, anyway.

  18. #18
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Google Sheets,, how to copy conditional formatting and update cell references?

    Quote Originally Posted by Newbie53 View Post
    When I asked a couple of days ago (I'm not allowed to post the link) I was told by another admin (6stringjazzer) that I could not combine the rules.
    What I told you is that you need a separate rule for each formatting style. You had described a situation where you had one rule for one color, and another rule for another color. Those cannot be combine into one rule. You can definitely combine rules into one formula if they have the same formatting style.

    In Google Sheets and also Excel, a conditional formatting rule is written to apply to the upper-left cell in the applicable range. No matter what cell you look at, that rule will always refer to the same cell. Let's say you want a rule to turn the cell red if the value is negative. You want this rule to apply to the range A1:D4. You would use the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If you look at the rule for D4, it will still say
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You can apply this rule to whatever cells you want, the formula will not change, and you do not have to manually alter the cell reference.

    I will try to review your thread and sheet and see if I can get down into the specifics as time permits.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Google sheets, conditional formatting based on another cell
    By Newbie53 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 05-17-2023, 07:56 AM
  2. Copy the conditional formatting formula rules with the corresponding cell references
    By vvishalb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2022, 02:49 AM
  3. [SOLVED] Google Sheets Conditional Formatting based on another cell value
    By Badvgood in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 12-16-2020, 12:07 PM
  4. Replies: 3
    Last Post: 08-01-2019, 01:35 PM
  5. Google sheets: Conditional formatting
    By rayted in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 7
    Last Post: 08-07-2018, 09:39 AM
  6. [SOLVED] Google Sheets: conditional formatting for cell containing letters and numbers
    By jher001 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 7
    Last Post: 04-13-2018, 03:18 PM
  7. [SOLVED] Conditional Formatting - Copy vs Cell References
    By hensj in forum Excel General
    Replies: 2
    Last Post: 09-14-2012, 09:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1