+ Reply to Thread
Results 1 to 16 of 16

Dragging Down formula for conditional formatting

  1. #1
    Registered User
    Join Date
    01-16-2020
    Location
    Australia
    MS-Off Ver
    365
    Posts
    8

    Dragging Down formula for conditional formatting

    Hi,

    I’m going to preface this with that I’m quite new to excel formulas so please bear with with me...

    I’m trying to create a master roster file which has multiple rosters in it (one roster per sheet). The purpose of this file is that certain rosters are run concurrently in a day so I wanted to add conditional formatting where if a person’s name appears on the same day on two different rosters their name is highlighted with the cell colour matching the sheet colour which they are duplicated in. So in essence a duplicate check. After some searching online I found this formula which seems to work:

    =MATCH(C6,INDIRECT("Olive!D4:E4"),0)

    I’ve conditional formatted this formula to apply to cells C6:J6 in the sheet I want. But I need to apply this to multiple rows so when I drag down the cells that formula updates to:

    =MATCH(C7,INDIRECT("Olive!D4:E4"),0) while I need it to update to =MATCH(C7,INDIRECT("Olive!D5:E5"),0). Just wondering if it’s possible for a formula in conditional formatting to be able to update it’s reference cells in another sheet when I drag down?

    Otherwise is there a formula that I can apply to a whole table where it looks at each row or row corresponding to a date and cross references to a row in another sheet or the row corresponding to a date in another sheet and highlights the duplicates? I tried the below and it didn’t work

    =MATCH(C6,INDIRECT("Olive!D4:E16"),0) to be applied to cells C6:J16

    Hope this question makes sense and thanks in advance!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Dragging Down formula for conditional formatting

    Use your original formula

    =MATCH(C6,INDIRECT("Olive!D4:E4"),0)

    All you need to do is edit the range that the conditional formatting applies to.

    Excel will handle the rest automatically.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    01-16-2020
    Location
    Australia
    MS-Off Ver
    365
    Posts
    8

    Re: Dragging Down formula for conditional formatting

    Hi mehmetcik,

    Thanks for the quick reply!

    Editing the range that the conditional formatting applies to does work but it makes the range only look at the reference cells D4:E4 in the sheet Olive. Eg if I set the range from C6:J6 to C6:J18, it will show be duplicates found in C6:J18 when referencing to D4:E4. But I need the roster to look up row by row. ie:
    C6:J6 looks at duplicates in D4:E4 in Olive sheet
    C7:J7 looks at duplicates in D5:E5 in Olive sheet
    C8:J8 looks at duplicates in D6:E6 in Olive sheet
    Etc...

    So is there a way to adjust it so the conditional formatting does that?

    Thanks!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Dragging Down formula for conditional formatting

    Why are you using INDIRECT in that formula?

    Pete

  5. #5
    Registered User
    Join Date
    01-16-2020
    Location
    Australia
    MS-Off Ver
    365
    Posts
    8

    Re: Dragging Down formula for conditional formatting

    Hi Pete,

    To be brutally honest I’m not entirely sure, it was the result of my googling and said it was needed since what I’m working with is text and not numbers

    I’ve attached a screen shot of an example of the page I’m working on - currently it’s set for C6:J6 if the name appears in I6:M6 it will highlight the cell green as shown. I was looking at having it apply multiple conditional formattings:
    1. To look at it row by row ie C7:J7 looks at I7:Attachment 658208M7, C8:J8 looks at I8:M8 within the same sheet and
    2. To do the above but also for another sheet as I mentioned above

    In my mind I think it should be the same formula for both conditions, but that’s my extremely limited excel knowledge
    Attachment 658208

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Dragging Down formula for conditional formatting

    Both attachment links come up as invalid when I click on them. You might have tried to use the Paperclip icon, which has not worked on this forum for many years (and the Tech Team don't seem to be willing/able to fix it).

    Instead, you should follow the instructions given in the yellow banner at the top of the screen, telling you how to attach a file to one of your posts.

    Pete

  7. #7
    Registered User
    Join Date
    01-16-2020
    Location
    Australia
    MS-Off Ver
    365
    Posts
    8

    Re: Dragging Down formula for conditional formatting

    Apologies Pete, I’ve tried to reattach the file now, let me know if it doesn’t work!

    Thanks!
    Attached Images Attached Images

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

    Re: Dragging Down formula for conditional formatting

    You've attached a screenshot - we need the file. Instructions at the top of the page.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  9. #9
    Registered User
    Join Date
    01-16-2020
    Location
    Australia
    MS-Off Ver
    365
    Posts
    8

    Re: Dragging Down formula for conditional formatting

    Sorry everyone! Still new to this forum... I’ve attached the file now

    Thanks for everyone’s input and trying to help so far!
    Attached Files Attached Files

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

    Re: Dragging Down formula for conditional formatting

    1. Select cell F6.
    2. Set the rule: =MATCH(C6,INDIRECT("Kindy!I6:M6"),0).
    3. Set the Applies to range: =$C$6:$F$100 - this is the bit you are missing.
    4. Apply.
    5. Get rid of all the extraneous rules you've set up for other rows!!!

  11. #11
    Registered User
    Join Date
    01-16-2020
    Location
    Australia
    MS-Off Ver
    365
    Posts
    8

    Re: Dragging Down formula for conditional formatting

    Thanks for the quick reply AliGW!

    I’ve done what you said but I do need each row to look up it’s corresponding row instead of just matching the whole table to I6:M6 - so I want it to highlight any names in C6:F6 that is duplicated in I6:M6 while for C7:F7 to highlight duplicates found in I7:M7, C8:F8 in I8:M8 etc... which is why I had all those rules per row as I couldn’t think of another way, but I also don’t want to have to do it row by row as it’s for a whole year and I have 8 rosters to go through...

    Hope my query makes sense! (And is possible....)

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

    Re: Dragging Down formula for conditional formatting

    I don't know why you are using INDIRECT.

    Explain in WORDS what the CF rule is meant to do.

  13. #13
    Registered User
    Join Date
    01-16-2020
    Location
    Australia
    MS-Off Ver
    365
    Posts
    8

    Re: Dragging Down formula for conditional formatting

    Thanks for the quick reply AliGW!

    So I’m trying to create a master roster file which has multiple rosters in it (one roster per sheet). I want to create a CF rule as certain rosters are run concurrently in a day so I wanted the CF rule to show if a person’s name appears on the same day on two different rosters their name is highlighted with the cell colour matching the sheet colour which they are duplicated in. So in essence a duplicate check.

    I didn’t know how to do this so I did some googling and came across the below formula (I wanted to post a link to the website that had the below formula but I haven’t posted enough to be allowed to put a link in my reply yet)

    =MATCH(C6,INDIRECT("Olive!D4:E4"),0)

    So in the CF rule I would like selected cells in a row in the table (say C6:J6) to look up the cells in another row (say I6:M6) and if there are duplicates then the duplicated name is highlighted in C6:F6. At the same time I would like the row (C6:J6) to look up another row in another see (Say Sheet Olive, D4:34) and if there is a duplicate in names then it highlights in C6:F6 as well. So each row needs to look up another row but they are in succession eg C6:J6 - I6:M6, C7:J7 - I7:M7, C8:J8 - I8:M8 etc...

    The above rule did work but I could not apply it on a mass scale as the CF rule would not update the cells in the rule when I dragged down/used format painter. But I need each row to look up another row as each row represents a new week in each roster. So since I the dragging didn’t work, it’s leading me to think that I’m probably not using the best formula and hence posting my conundrum in this forum to seek the help of those, like yourself, who are much better at excel than I am.

    Hope this clears things up and makes sense as to what I’m trying to achieve.

    Thanks in advance!

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,884

    Re: Dragging Down formula for conditional formatting

    To make this work with the current layout try the following:
    1. Modify the formula for the Green CF rule to read: =MATCH(C6,$I6:$M6,0) Applies to =$C$6:$F$70
    2. Remove the Merge and Center on the Olive sheet (cells A4:A5) and type the date in each cell (date in A4 hidden using white font)
    3. Populate helper columns (N:Q) on the Kindy sheet using: =INDEX(Olive!$D$4:$D$30,AGGREGATE(15,6,(ROW($D$4:$D$30)-ROW($D$3))/(Olive!$A$4:$A$30=$A6),COLUMNS($A$1:A$1)))
    Note that the helper columns may be moved and/or hidden for aesthetic purposes.
    4. Modify one of the formulas for the Yellow CF rule to read: =AND(C6<>"",MATCH(C6,$N6:$Q6,0)) Applies to =$C$6:$F$70 (delete the other yellow CF rule)
    If there are more sheets of rosters you may want to consider producing a master roster where one column is populated with the sheet name of the individual roster (i.e. Kindy). Identify the conflicts on the master roster and use INDEX based formulas to fill the individual rosters.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  15. #15
    Registered User
    Join Date
    01-16-2020
    Location
    Australia
    MS-Off Ver
    365
    Posts
    8

    Re: Dragging Down formula for conditional formatting

    Oh my goodness JeteMc! Everything works amazingly, what a perfect solution! Thank you so much!! Been boggling my mind of weeks, thanks for all your time and effort in helping me!

  16. #16
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,884

    Re: Dragging Down formula for conditional formatting

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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. Replies: 2
    Last Post: 01-03-2018, 01:26 PM
  2. Replies: 4
    Last Post: 10-19-2016, 04:10 PM
  3. Replies: 3
    Last Post: 06-19-2015, 07:16 AM
  4. Dragging Conditional Formatting Down
    By Sky188 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-10-2014, 04:57 PM
  5. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  6. Dragging down a conditional format?
    By doowop5000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-10-2007, 09:16 AM
  7. Dragging Conditional Formatting
    By Frawst in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-17-2006, 04:35 PM

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