+ Reply to Thread
Results 1 to 4 of 4

How do you convert a date to decimal?

  1. #1
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164

    How do you convert a date to decimal?

    For instance, let's say I have a date of 10/23/11. I want to convert this date to decimals. So 10/23/11 would be 9.7419 months in this calender year. How does one do this?
    Office 2010

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,982

    Re: How do you convert a date to decimal?

    Assume your current date is in M3 and your start of the year date is in M2, then use this formula.

    =MONTH(M3)-MONTH(M2)+(M3-DATE(YEAR(M3),MONTH(M3),1))/(EOMONTH(M3,0)-EOMONTH(M3,-1))

    Format as a number with as many decimals you want.

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

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

    Re: How do you convert a date to decimal?

    With a date in A1 this formula should do it

    =MONTH(A1)-1+DAY(A1)/DAY(EOMONTH(A1,0))

    format as number
    Audere est facere

  4. #4
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164

    Re: How do you convert a date to decimal?

    Awesome! I had almost the same formula using days, I was not aware I could do months as well. Very big thanks to both of you!

+ 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