+ Reply to Thread
Results 1 to 5 of 5

Logical test formula not updating when date is changed

  1. #1
    Registered User
    Join Date
    08-15-2012
    Location
    Fort Wayne, IN, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Logical test formula not updating when date is changed

    I was given someone else's worksheet (who no longer works here) to update for the coming 2013 year. The purpose of the formula in question is to automatically calculate FTE based on start and end date for each month. When I changed the date ranges from 1/1/2012 to 1/1/2013; and end date 12/31/2012 to 12/31/2013, the formula returns the equivelent of 0 instead of 1. If I leave the start range blank, it will calculate 1.

    Here is the formula for January:

    =IF($J3<=DATE(YEAR(M$1),MONTH(M$1),1),IF($K3>=M$1,1,IF($K3<DATE(YEAR(M$1),MONTH(M$1),1),0,NETWORKDAYS(DATE(YEAR(M$1),MONTH(M$1),1),$K3)/NETWORKDAYS(DATE(YEAR(M$1),MONTH(M$1),1),DATE(YEAR(M$1),MONTH(N$1),0)))),IF($J3<=M$1,NETWORKDAYS($J3,M$1)/NETWORKDAYS(DATE(YEAR(M$1),MONTH(M$1),1),DATE(YEAR(N$1),MONTH(N$1),0)),0))

    Any help would be much appreciated.
    Thanks,
    Maggie

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Logical test formula not updating when date is changed

    Can you post the workbook, it is meaningless without the data.

  3. #3
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Logical test formula not updating when date is changed

    Hi Maggie,

    There's nothing in the formula to indicate that it would be sensitive to your changing the date ranges. What data do you have in cells: J3, K3, M1, and N1? Did you change the dates in each of these cells?
    Docendo discimus.

  4. #4
    Registered User
    Join Date
    08-15-2012
    Location
    Fort Wayne, IN, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Logical test formula not updating when date is changed

    I can't post the workbook b/c of the sensitivity of where I work.

    J3 is start date
    k3 is end date
    m1 is january
    n1 is february

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,736

    Re: Logical test formula not updating when date is changed

    Quote Originally Posted by MLBarie View Post
    J3 is start date
    k3 is end date
    m1 is january
    n1 is february
    Hello Maggie

    Judging by your formula M1 and N1 (and other dates, presumably you have one for each month of the year) are the last day of the month, i.e. 31st Jan 2012 and 29th Feb 2012. They may be formatted to show just the month name but if you want the formula to work for 2013 you need to update those dates so that they are 31st Jan 2013, 28th feb 2013 etc.

    You can make any change easier by having a single cell with the year, e.g. in J1 put the year, e.g. 2013

    Then in M1 use this formula to generate the last day of Jan for that year

    =DATE(J1,1,31)

    and in N1 copied across use this formula

    =EOMONTH(M1,1)

    Now if you change the year in J1 all the months will change automatically as required

    ....also I think you can use this formula to simplify the FTE calculation

    =MAX(0,NETWORKDAYS(MAX($J3,M$1-DAY(M$1)+1),MIN($K3,M$1))/NETWORKDAYS(M$1-DAY(M$1)+1,M$1))
    Audere est facere

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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