Forum Discussion

Rayven1's avatar
Rayven1
Copper Contributor
Apr 12, 2023

Automatically highlight rows based off a number in a cell.

Hello, 

I would like to have rows automatically highlighted based on a number in a cell. For example, Cell I3 has the number 15. I would like for 15 cells in a row to be highlighted green starting at today's calendar week. Please see pic for reference. 

I would like to do red 0-4, yellow 4-8, and green 8+. I'm not sure if this is entirely possible so that's why i'm here! Thanks in advance for any help!

2 Replies

  • mathetes's avatar
    mathetes
    Silver Contributor

    Rayven1 

     

    I'm not sure if this is entirely possible so that's why i'm here!

     

    It's possible.

     

    But you would help us help you if (1) you would clarify the rules you want applied

    • Cell I3 has the number 15. I would like for 15 cells in a row to be highlighted green starting at today's calendar week.
    • I would like to do red 0-4, yellow 4-8, and green 8+.

    The green for 8+ is consistent with your desire for the 15

    But what do you want for the values 4 and 8? You ascribe them to two different colors.

     

    The second thing you could do to help us help you is to post a copy of the spreadsheet behind the image you posted. To have the actual conditional formatting formula that is applicable to your spreadsheet, we'd need to know how you have coded those calendar week headings. So please post a copy of the spreadsheet on OneDrive or GoogleDrive with a link pasted here that grants access.

     

  • mtarler's avatar
    mtarler
    Silver Contributor

    I believe this will be possible. you will need a different rule for each color. You will create a custom formula for the rule and create a formula that identified if any given cell in the 'Applies To' range should be highlighted. That rule must be written for the upper left most cell in the 'Applies To' range and use $ to lock columns or rows of reference that should stay the same as excel evaluates other cells in that range (and cols and row reference without $ will increment accordingly). so if the Applies To range is A1:G100 and your formula is =(A1>$A$1) then any cell in that range that is > than the value in A1 will get highlighted and a formula =(A$1>$A$1) will highlight the entire column based on the value in row 1 being > the value in A1.

    if you attach the file or make it available on a share site like SharePoint we could probably help more.  Also, the formula to determine "today's calendar week" could be done based on the text you have or just based on column numbers but note if you put in 15 today it will highlight based on today and then next week that group being highlighted will shift, I just wanted to verify you realize that and didn't expect that it would magically "stick" to starting this week.  If you want that to 'stick' to a particular starting week you need that included in the table.

Resources