+ Reply to Thread
Results 1 to 3 of 3

Conditional Formatting - DATEDIF

  1. #1
    Forum Contributor
    Join Date
    07-07-2014
    Location
    Nottingham
    MS-Off Ver
    Office 2016, Office 365
    Posts
    400

    Conditional Formatting - DATEDIF

    In the following post I had help with a Nested IF DATEDIF Function
    https://www.excelforum.com/excel-for...f-datedif.html

    Background:
    I am creating a worksheet to allow me to calculate home much Annual Leave to give staff for the coming fiscal year.

    My IF DATEDIF function allows me to give either 0, 2 or 6 extra days Annual Leave

    What I want to be able to have is Conditional Formatting to know if someone's DATEDIF becomes either 5 or 10 years in the next fiscal year.

    i.e. If someone's current DATEDIF is 4 years and 6 months, then in the next 12 months this will become 5 years, and so as such they will need to have a Pro Rata addition of 2 days - I am happy to calculate this manually, but I need their DATEDIF cell to change colour to alert me to the fact that I will need to run a manual calculation

  2. #2
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Conditional Formatting - DATEDIF

    Assuming you are from Nottingham UK, Google said your fiscal year runs from 6th April to 5th April. Is that what you want in this sheet?

    If so, the current financial year is;

    =YEAR($K$1)+(MONTH($K$1)>3)-AND((MONTH($K$1)=4),(DAY($K$1)<6))

    and the financial year of the staff members start date is;

    =YEAR($J2)+(MONTH($J2)>3)-AND((MONTH($J2)=4),(DAY($J2)<6))

    So you want to highlight if the difference of those two years = 9 or =4 with two different colours?

    So CF1 formula

    =(YEAR($K$1)+(MONTH($K$1)>3)-AND((MONTH($K$1)=4),(DAY($K$1)<6))) - (YEAR($J2)+(MONTH($J2)>3)-AND((MONTH($J2)=4),(DAY($J2)<6)))=9

    CF2 formula

    =(YEAR($K$1)+(MONTH($K$1)>3)-AND((MONTH($K$1)=4),(DAY($K$1)<6))) - (YEAR($J2)+(MONTH($J2)>3)-AND((MONTH($J2)=4),(DAY($J2)<6)))=4

    Give them 2 different colours, Bob's your uncle.

    PS. If you want the 1st of the month, you just need to remove

    -AND((MONTH($K$1)=4),(DAY($K$1)<6)) ... from the formulae...BOTH occurrences in each. (makes it much easier)
    Last edited by Croweater; 01-12-2023 at 08:16 PM.

  3. #3
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Conditional Formatting - DATEDIF

    Despite having put up at least two more problems since, I see that you haven't bothered to respond to my questions or the suggested solution, so I assume I guessed all of your requirements correctly?

    This is the second time you haven't bothered to respond to a solution from me. Normally people only get away with this once.

    I won't be wasting any more of MY time on any more of YOUR problems. A simple 'Thanks for the help' is not too much to ask, so you will NOT be getting any more help from me.

+ 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. DATEDIF -- date formatting problem (I think)
    By whatmary in forum Excel General
    Replies: 3
    Last Post: 08-13-2018, 02:53 PM
  2. [SOLVED] Override conditional formatting (in general, without changing the conditional formatting)
    By Stormin' in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2017, 07:15 AM
  3. DatedIf formula with conditional formating and color coding
    By Scrapnforfun in forum Excel General
    Replies: 1
    Last Post: 05-20-2017, 12:50 AM
  4. [SOLVED] DATEDIF - DATEDIF Calculation returning a negative for days or months
    By DaveBre in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-27-2015, 06:22 PM
  5. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  6. [SOLVED] Help w/ DATEDIF formula and Conditional Formatting
    By xxxombie88 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-05-2013, 07:18 PM
  7. DateDif Average? Damn DateDif
    By UTCHELP in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-10-2012, 08:53 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