+ Reply to Thread
Results 1 to 6 of 6

Date formula question

  1. #1
    Registered User
    Join Date
    08-06-2007
    Posts
    13

    Date formula question

    Hi

    I"m trying to get the formula below to work but I just get "#VALUE" written as a return when A1 refers to a cell that has a date entered (date formatted).

    =DATE(YEAR(A1),MONTH(A1)+6,DAY(A1))

    I am a novice at this

    What am I doing wrong??

  2. #2
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    I couldn't get the formula to fail unless I used a non-date text in the field (even typing in August 1 as text didn't return an error).

    Can you show what is actually in the date cell?

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    That formula is valid. If it gives a #VALUE! error that means A1 doesn't contain a date (or even a number).

    If A1 looks like a date then it's probably formatted as text or contains some spaces.

    Try using "Text to Columns" to convert

    Select column with date(s)

    Data > Text to columns > Next > Next > at step 3 select "date" from "column data format" and required date type e.g. DMY. Finish

  4. #4
    Registered User
    Join Date
    08-06-2007
    Posts
    13

    Problem solved but here's a related one...

    Hey it works now thank you.

    My problem was that the dates in A1 weren't being recognised because I was inputting them as 3.07.07 instead of 3/07/07 and excel was "seeing them as text".

    Next question, for those that still have patience for me:

    How do I get the formula below to reject returns that arise when J3 or K3 is blank?

    =DATE(YEAR(K3), MONTH(K3), DAY(K3)+(J3*7))

    Many thanks

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Rather than

    =DATE(YEAR(K3), MONTH(K3), DAY(K3)+(J3*7))

    it's easier to use

    =K3+J3*7

    To return a blank if either K3 or J3 is blank try

    =IF(OR(K3="",J3=""),"",K3+J3*7)

  6. #6
    Registered User
    Join Date
    08-06-2007
    Posts
    13
    Thanks muchly. That's done the trick!

+ 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