+ Reply to Thread
Results 1 to 7 of 7

Auto-Created Date field not displaying correctly.

  1. #1
    Registered User
    Join Date
    08-08-2011
    Location
    Warwick
    MS-Off Ver
    Excel 2003
    Posts
    48

    Auto-Created Date field not displaying correctly.

    Hello all,

    I have a Cell that automatically works out and displays the date for the 1st sunday in the month depending on the date in cell B1:

    Please Login or Register  to view this content.
    This works like a dream and displays the date in the format i'm after which is:

    yyyymmdd hhmm

    Now, my main issue is when I try and add the date from the above formula into another (very long) formula. I've attached the code below, but the problem is when I use a cell reference to insert this date, it displays a random number (40790). I've changed the format of the cell containing the below formula to a date format, but it's making no difference

    Please Login or Register  to view this content.
    The Cell reference that I am talking about is the one that looks like this: ", Diesel!$B$2,".

    Does anyone have any ideas as to why the date is being shown perfectly in one cell, but whenever I try and reference it somewhere else it is shown as a random number?

    Thanks in advance


    - Jon
    Last edited by JonathanMoore; 09-19-2011 at 05:35 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Auto-Created Date field not displaying correctly.

    You can force the reference to Diesel!$B$2 into the format that you want using ... TEXT(Diesel!$B$2,"yyyymmdd hhmm")

  3. #3
    Registered User
    Join Date
    08-08-2011
    Location
    Warwick
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Auto-Created Date field not displaying correctly.

    Thanks for the reply Andrew - i'm just not sure how to add in your suggestion:

    It's the "CONCATENATE" function that seems to be causing the issue and whenever I add in the:

    Please Login or Register  to view this content.
    Code it just places the word "TEXT" before the number that should be the date - have I done this incorrectly?


    thanks,

    - Jon

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Auto-Created Date field not displaying correctly.

    The concatenate function is making a text string, so just replacing the reference to Diesel!$B$2 with the formula I gave, without any quotation marks around it, should include the date/time from $B$2 in the correct format.

  5. #5
    Registered User
    Join Date
    08-08-2011
    Location
    Warwick
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Auto-Created Date field not displaying correctly.

    replacing the cell reference with your formula gives an error (Your Formula Contains an Error) and it highlights the "yyyymmdd" section as the issue

    Thanks a lot!

    Jon

  6. #6
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Auto-Created Date field not displaying correctly.

    Could you post the entire formula you're now trying to use.

    It should be:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-08-2011
    Location
    Warwick
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Auto-Created Date field not displaying correctly.

    I'd missed out the ", before the "TEXT" value... this code works perfectly... thanks

+ 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