+ Reply to Thread
Results 1 to 9 of 9

Highlight cells according to date range in other cells

  1. #1
    Registered User
    Join Date
    03-24-2017
    Location
    Auchterarder, Scotland
    MS-Off Ver
    Microsoft 365
    Posts
    78

    Highlight cells according to date range in other cells

    Hi.
    I have a simple sheet that I would like to format according to dates that are inputted in some columns.

    If you see the attached file:

    I have currently just manually entered the '1' figure corresponding to the dates dictated in columns D and E. I would like to have had these populated automatically.

    When I have put in a New Finish date, I would like the appropriate cells to have be formatted differently (probably a coloured fill). So, any cell from that date up until the original Finish date to be highlighted.

    The collection time would have to be formatted in a further colour, with those dates going out further than the New Finish date. For example, the Fridge Freezer New Finish Date is on 20-Dec-20 - I would like the next two weeks after that to be highlighted in a different colour than has been used for the other cells.

    I hope this makes sense.

    I would be able to do this myself if all the cells had the dates in them, but I need to be referring to the cells in row 2 - that's where I am having the problem!

    Thank You in advance for nay help.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Highlight cells according to date range in other cells

    If you don't mind me saying so.... that's a pretty awful sample, as we have to scroll over 400+columns to see the data!!!

    CF1 =AND(I$2>=MIN($E3,$F3),I$2<=MAX($E3,$F3))

    CF2 =AND(I$2>=$D3,I$2<=$E3)

    Apply to your entire range. I changed the dates in the first two rows to stop 00's of columns worth of scrolling.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    03-24-2017
    Location
    Auchterarder, Scotland
    MS-Off Ver
    Microsoft 365
    Posts
    78

    Re: Highlight cells according to date range in other cells

    Hi Glenn, Thank You.
    Yes - I should've reduced the columns!
    I'm unsure how to apply those formulae to the cells in my sheet.

  4. #4
    Registered User
    Join Date
    03-24-2017
    Location
    Auchterarder, Scotland
    MS-Off Ver
    Microsoft 365
    Posts
    78

    Re: Highlight cells according to date range in other cells

    I have attached now a better version, and manually entered how I would like the sheet to look like.
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Highlight cells according to date range in other cells

    I'm away for a couple of hours. I just realised that my previous effort was no good. You need two colours for amended end dates... one for earlier than anticipated and another for later than anticipated.

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Highlight cells according to date range in other cells

    With 3 CF formula's I come to this result.
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  7. #7
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Highlight cells according to date range in other cells

    Thanks for the reputation points

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Highlight cells according to date range in other cells

    There are 3 conditions that need to be met.

    1. Finishes on time (blue).
    2. Finishes later than anticipated (extra days in red)
    3. Finishes earlier than anticipated (days saved in green).

    1. =AND(H$2>$D3,H$2<=$E3)
    2. =AND($F3>=H$2,$E3<H$2)
    3. =AND($E3<>$F3,$F3<=H$2,$E3>=H$2)

    CF applied to: $H$3:$BM$8
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    696

    Re: Highlight cells according to date range in other cells

    Please have a look at this.

    I have use the below formula (Cell H12 and copied & pasted to the rest of the cells)

    =IF(AND(H$11>=$D12,H$11<=$F12),1,IF(AND($F12+$G12<H$11,H$11<=$E12),3,IF(AND($F12+$G12>=H$11,H$11<$E12,H$11>C$14),2,"")))

    Blue= New Start and End Date
    Dark Blue= Between New Finish and Finish Date
    Grey for other
    Attached Files Attached Files

+ 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. Using date Pickers to highlight range of cells...
    By TheOddOneOut in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2019, 06:20 AM
  2. Replies: 4
    Last Post: 02-06-2017, 10:20 PM
  3. [SOLVED] Highlight a range of cells to match the date
    By cmoore24 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-14-2015, 12:59 PM
  4. [SOLVED] highlight a series of cells based on the number of days in a date range
    By b2lynch in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-09-2014, 10:48 PM
  5. Date Range to highlight Cells
    By Arawwawala in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2014, 02:34 PM
  6. Replies: 4
    Last Post: 01-03-2013, 12:25 AM
  7. Highlight or colour a cell or cells based on cells in another range.
    By baffld in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-30-2012, 08:41 PM

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