+ Reply to Thread
Results 1 to 4 of 4

Date Function

  1. #1
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    Question Date Function

    Hi,

    I have =DATE(2006,1,1) in cell B5 (with custom format mmm yyyy) and entered =DATE(YEAR(B5),MONTH(B5),1) in cell A7 (with custom format d). Then I entered =IF(DATE(YEAR(B5),MONTH(B5),DAY(A7)+1)>DATE(YEAR(B5),MONTH(B5)+1,0),"",DATE(YEAR(B5),MONTH(B5),DAY(A7)+1)) in cell A8 (with custom format d),which I want to copy down the next twenty-nine cells (also with custom format d), but it is giving the error #NUM! What have I done wrong?

    Thanks,
    Gos-C
    Using Excel 2010 & Windows 10
    "It is better to be prepared for an opportunity and not have one than to have an opportunity and not be prepared."

  2. #2
    Kevin Vaughn
    Guest

    RE: Date Function

    You don't mention what is in B6, but since you are using relative reference
    for B5, if B6 were a negative number, you could get a #num error when you
    copy down. You probably want to make B6 absolute ($B$6).
    --
    Kevin Vaughn


    "Gos-C" wrote:

    >
    > Hi,
    >
    > I have *=DATE(2006,1,1)* in cell B5 (with custom format mmm yyyy) and
    > entered *=DATE(YEAR(B5),MONTH(B5),1)* in cell A7 (with custom format
    > d). Then I entered
    > *=IF(DATE(YEAR(B5),MONTH(B5),DAY(A7)+1)>DATE(YEAR(B5),MONTH(B5)+1,0),"",DATE(YEAR(B5),MONTH(B5),DAY(A7)+1))*
    > in cell A8 (with custom format d),which I want to copy down the next
    > twenty-nine cells (also with custom format d), but it is giving the
    > error #NUM! What have I done wrong?
    >
    > Thanks,
    > Gos-C
    >
    >
    > --
    > Gos-C
    >
    >
    > ------------------------------------------------------------------------
    > Gos-C's Profile: http://www.excelforum.com/member.php...o&userid=14518
    > View this thread: http://www.excelforum.com/showthread...hreadid=507893
    >
    >


  3. #3
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408
    Thanks, Kevin. The problem was not related to relative cell reference (even though I had to make cell B5 absolute when copying the formula down). Cell B6 had Page 1. I used the same formula on a new sheet and everything worked.

    Gos-C

  4. #4
    Kevin Vaughn
    Guest

    Re: Date Function

    Glad you got it working.
    --
    Kevin Vaughn


    "Gos-C" wrote:

    >
    > Thanks, Kevin. The problem was not related to relative cell reference
    > (even though I had to make cell B5 absolute when copying the formula
    > down). Cell B6 had Page 1. I used the same formula on a new sheet and
    > everything worked.
    >
    > Gos-C
    >
    >
    > --
    > Gos-C
    >
    >
    > ------------------------------------------------------------------------
    > Gos-C's Profile: http://www.excelforum.com/member.php...o&userid=14518
    > View this thread: http://www.excelforum.com/showthread...hreadid=507893
    >
    >


+ 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