+ Reply to Thread
Results 1 to 2 of 2

!NUM# when adding +1 month in Date function

  1. #1
    Registered User
    Join Date
    03-07-2005
    Posts
    17

    !NUM# when adding +1 month in Date function

    I have a complicated financial model (xlsm 2010) that is recently giving me fits.

    I am using date(yyyy+x,mm+1,1) to get the first of the next month. Here's the actual formula:

    =DATE(YEAR(LANDACQ_DATE)+BJ8,MONTH(LANDACQ_DATE)+1,1)-1 where LANDACQ_DATE is a input date and BJ8 is an integer from 1 to 12.

    When it hits month 13, it should roll to January. Very familiar with it and used it in this same model.
    A co-worker sent me a model with an error in it I traced to a row of date functions. The formula Date(yyyy,mm+1,dd) is returning !NUM#. I try breaking the formula into steps, A4 to calc the year, A5 for the month, and A6 for the day. Guess what? Date(A4,A5,A6) returns !NUM#. To check my syntax, I type in =date(2017,13,1) and I get !NUM#.

    The really weird part, when I type that formula on ANY OTHER sheet in that workbook, it works.
    Last edited by TXdore; 10-30-2012 at 11:05 PM. Reason: additional details

  2. #2
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: !NUM# when adding +1 month in Date function

    The formulas work on my machine (except, with the -1 in there, I get the last day of the month).

    Perhaps your date system is not set correctly on your system or in the Excel options.

    That probably won't help, but it may be a start.
    Mark

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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