+ Reply to Thread
Results 1 to 4 of 4

Explain date formula

  1. #1
    Registered User
    Join Date
    08-31-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Explain date formula

    Hello fellow excel users,

    I had a quick question. What does this formula mean?

    =IF(ISTEXT(A2),REPLACE(MID(A2,4,3)&A2,7,3,"")+0,DATE(YEAR(A2),DAY(A2),MONTH(A2)))

    I get the gist but can someone break it down for me please?

    Appreciate the help!

  2. #2
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Explain date formula

    On a quick glance, it would seem that you have cells where data is input in 2 different ways:

    1) Excel recognizes the cell content as a date; which means that it's a serial number, causing the =ISTEXT() part to return FALSE, and thus enabling you to use the =DATE() formula. (Which might actually be redundant; try to replace DATE(YEAR(A2),DAY(A2),MONTH(A2)) with A2)
    2) Excel does not recognize cell contents as date, causing it to be treated as text; and thus the =ISTEXT() returns true. The =REPLACE() part then manipulates cell contents in some way.
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  3. #3
    Registered User
    Join Date
    08-31-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Explain date formula

    Thank you Larsen.

    I get that bit. It is just the individual parts. This code converts American dates to European dates and I don't quite get why and how.

  4. #4
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Explain date formula

    Perhaps you can provide an example?

+ 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