+ Reply to Thread
Results 1 to 6 of 6

Excel 2003 - Conditional formatting based on date and to clear when data input

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    Birmingham
    MS-Off Ver
    Excel 2003
    Posts
    21

    Excel 2003 - Conditional formatting based on date and to clear when data input

    Hi guys,

    Need your help and been told may need some conditional formatting to go in.

    In my spreadsheet column G records the target date for an action plan. Column H records the completed date.

    I need to do some conditional formatting to apply the following:

    Lets say the target date for the action plan is 20/04/2014. 5 working days before the target date I want the row to turn yellow, 3 working days I want it to turn yellow and when there are 2 working days left until that date I want it to turn red.

    At any time if column H is filled in because the action plan has been completed, I do not want any of the conditional formatting to apply and the row to remain clear as don't want it being flagged up. Also want the row to stay clear until the conditional formatting requested applies (sorry if this is obvious but just making sure I'm clear in what I say)

    The calculation has to be based on working days. Is this possible?

    Thanks

    Imran
    Last edited by imranrasool; 04-14-2014 at 12:29 PM.

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Excel 2003 - Conditional formatting based on date and to clear when data input

    Make the check for Row H your first Condition. =IsBlank(H2)
    Make the check for less than two days your second condition. You need to enable the Analysis Tool Pack Add-in for the function to Work

    =Networkdays(G2,Today())<2

    For less than 5 the third.

    =Networkdays(G2,Today())<5

    Check out the help file for the Networkdays function to show you how to add holidays to it. (below)



    NETWORKDAYS function
    Show All
    Hide All
    This article describes the formula syntax and usage of the NETWORKDAYS function (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) in Microsoft Excel.

    Description
    Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days worked during a specific term.

    Tip To calculate whole workdays between two dates by using parameters to indicate which and how many days are weekend days, use the NETWORKDAYS.INTL function.


    Syntax
    NETWORKDAYS(start_date, end_date, [holidays])The NETWORKDAYS function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

    Start_date Required. A date that represents the start date.
    End_date Required. A date that represents the end date.
    Holidays Optional. An optional range of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of cells that contains the dates or an array constant (array: Used to build single formulas that produce multiple results or that operate on a group of arguments that are arranged in rows and columns. An array range shares a common formula; an array constant is a group of constants used as an argument.) of the serial numbers that represent the dates.
    Important Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text.

    Remarks
    Microsoft Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900. Microsoft Excel for the Macintosh uses a different date system as its default.
    If any argument is not a valid date, NETWORKDAYS returns the #VALUE! error value.
    Example
    The example may be easier to understand if you copy it to a blank worksheet.

    How do I copy an example?

    Select the example in this article.
    Important Do not select the row or column headers.



    Selecting an example from Help

    Press CTRL+C.
    In Excel, create a blank workbook or worksheet.
    In the worksheet, select cell A1, and press CTRL+V.
    Important For the example to work properly, you must paste it into cell A1 of the worksheet.

    To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
    After you copy the example to a blank worksheet, you can adapt it to suit your needs.



    A B
    Date Description
    10/01/2008 Start date of project
    3/01/2009 End date of project
    11/26/2008 Holiday
    12/4/2008 Holiday
    1/21/2009 Holiday
    Formula Description (Result)
    =NETWORKDAYS(A2,A3) Number of workdays between the start and end date above (108)
    =NETWORKDAYS(A2,A3,A4) Number of workdays between the start and end date above, excluding the first holiday (107)
    =NETWORKDAYS(A2,A3,A4:A6) Number of workdays between the start and end date above, excluding every holiday above (105)


    Note To convert the range of cells used for holidays in the last example into an array constant, select reference A4:A6 in the formula and then press F9.
    Last edited by Neil_; 04-14-2014 at 12:41 PM.
    Frob first, tweak later

  3. #3
    Registered User
    Join Date
    04-16-2013
    Location
    Birmingham
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Excel 2003 - Conditional formatting based on date and to clear when data input

    Hi Neil_,

    Thank you for you response. I'm having trouble applying what you have said. The first part works fine, i.e. isblank(H2). The second part I get the following message " you may not use references to other worksheets or workbooks for conditional formatting criteria".

    I think networkdays is what is causing the problem. Maybe it only works in formulas and vba code and not conditional formatting?

    Apologies if I have done anything wrong, but have copied it exactly as you have written it.

    Thanks

    Imran

  4. #4
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Excel 2003 - Conditional formatting based on date and to clear when data input

    Sorry, I don't have 2003 to test it. It works with 2010. Here's an alternative to Networkdays, but it's slightly more complex.

    http://www.cpearson.com/excel/betternetworkdays.aspx

  5. #5
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Excel 2003 - Conditional formatting based on date and to clear when data input

    Ignore last post as they array formulas.

    I can confirm that 2003 dosen't support add in functions with conditional formatting. You could create a couple of hidden helper columns with the workday formulas in and refer to them in your conditional formatting

  6. #6
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Excel 2003 - Conditional formatting based on date and to clear when data input

    Book1.xls

    Heres an example of it working

  7. #7
    Registered User
    Join Date
    04-16-2013
    Location
    Birmingham
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Excel 2003 - Conditional formatting based on date and to clear when data input

    Hi Neil_,

    I will try upload my spreadsheet when I get home, as work does not have flashplayer and the manage attachments utility doesnt work here.

    I've tried the method you suggested and not getting it right for some reason. A colleague has said it maybe I actually need a macro as it provides more freedom. If that is the case then I am in trouble as havne't the foggiest about writing them.

    Thanks for your time and help, which is very appreciated.

    Thanks

    Imran

+ 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. Excel 2003 Conditional Formatting Using Specific Date
    By somethingfunny in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-08-2013, 02:21 PM
  2. [SOLVED] Excel 2010 Conditional Formatting to Highlight input cells based on Dates
    By chrisb84 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-20-2013, 09:39 AM
  3. Replies: 4
    Last Post: 02-25-2013, 06:43 PM
  4. Replies: 2
    Last Post: 09-20-2011, 12:32 AM
  5. Conditional Formatting & Data Validation Lists - Excel 2003
    By joelr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2010, 01:29 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