+ Reply to Thread
Results 1 to 8 of 8

Copy conditional formatting using a formula to the next column

  1. #1
    Registered User
    Join Date
    11-08-2023
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    8

    Copy conditional formatting using a formula to the next column

    Hi Team

    example.png

    Here is my data with red, yellow, green conditional formatting.

    the formulas I am using are as follows (the table to the right of the photo is actually on another tab called 'Traffic light math')

    RED - if less than =SUM(L4*'Traffic Light Math'!E$9)
    YELLOW - if between =SUM(L4*'Traffic Light Math'!E$9) =SUM(L4*'Traffic Light Math'!E$8)
    GREEN - if greater than =SUM(L4*'Traffic Light Math'!E$8)

    Issue is when i use the format paint brush option to copy the conditional formatting, it doesnt adjust the cell references to the new cell. I have tried adjusting the absolute options with no luck.

    Any help would be great

    Matt
    Attached Files Attached Files
    Last edited by mattdennis1402; 11-09-2023 at 12:45 AM.

  2. #2
    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: Copy conditional formatting using a formula to the next column

    Welcome to the Forum mattdennis1402!

    It is not possible to tell what cells in your screenshot correspond to the cells in the formula. Also, what cell are you trying to copy formatting from, and what cell are you trying to paint it to?

    When you paint to another cell, the rule will still be the same. The formula will be same for all cells in the Applies To range, so depending on specifically what you are doing, the formula will not adjust the references to the new cell. Are you saying that you paint it, but it doesn't work as expected in the new cell?

    I suggest you either attach an actual Excel file (see yellow banner at the top of the page), or show a screenshot with column and row headings.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-08-2023
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Copy conditional formatting using a formula to the next column

    Thanks for the reply

    I have attached a sample doc to my post now.

    essentially I want result in L10 to conditionally format based on L4*'Traffic light math'!$E$8

    I then want to be able to copy that conditional formatting rule to do the same thing for columns M, N, O, P

    hope this makes sense

  4. #4
    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: Copy conditional formatting using a formula to the next column

    All of the rules you have now are not what you describe in your post so I'm overhauling this. (For examples, rules applied to L10 reference $P4 instead of L4).

    When you reference L4, you could use a relative reference, since you are only formatting row 10. However, for best practice, I am going to recommend you use an absolute reference for the row (L$4).

    All references to value in Traffic light math should be absolute, as you show.

    You only need one rule for each color. See attached file. Here is a quick view of the rules:

    CF rules.jpg
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-08-2023
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Copy conditional formatting using a formula to the next column

    Thanks for your reply.

    I understand the formula and screen shot you have shared. The issue I have now is if you use the format painter tool to copy formatting from L10 and apply it to M10. The conditional formatting rules for M10 are still referencing L4 (I need it to reference M4) and then so on as I paste into the next column.

    L10 correct formula:
    Attachment 849003

    M10 Incorrect after using format painter from L10
    Attachment 849004

  6. #6
    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: Copy conditional formatting using a formula to the next column

    You need to do some homework on how conditional formatting formulas work. When a condition applies to more than one cell, the formula is written as though it were only for the cell in the upper left corner of the range. You will note that after you paint to column M, the Applies To range is now $L$10:$M$10. Therefore the formula will reference L4, which is what is needed to format L10. If you experiment with the numbers you will find that the colors in M10 act exactly as you want.

    This might be helpful.

  7. #7
    Registered User
    Join Date
    11-08-2023
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Copy conditional formatting using a formula to the next column

    Thanks for your help appreciate it

  8. #8
    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: Copy conditional formatting using a formula to the next column

    Have we resolved everything? If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking addreputationiconsmall.jpg below their name.

+ 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. How to copy the Conditional Formatting formula
    By Veron88 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-29-2021, 02:37 AM
  2. [SOLVED] Copy A Conditional Formatting Rule In Multiple Cells In One Column
    By Jim Parker in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-03-2015, 03:55 PM
  3. copy formula and the conditional formatting to the last row of data
    By shaz0503 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2014, 01:09 AM
  4. Replies: 5
    Last Post: 09-24-2012, 05:14 PM
  5. [SOLVED] Copy Conditional formatting to different formula
    By waelkash in forum Excel General
    Replies: 2
    Last Post: 07-19-2012, 06:00 PM
  6. Conditional formatting copy formula down?
    By 4am in forum Excel General
    Replies: 1
    Last Post: 04-26-2011, 12:38 PM
  7. copy formula's and conditional formatting to another sheet..
    By crizzle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2008, 11:20 AM

Tags for this Thread

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