+ Reply to Thread
Results 1 to 3 of 3

Decimal places

  1. #1
    Registered User
    Join Date
    01-17-2006
    Location
    UK
    MS-Off Ver
    Office 2016 Professional
    Posts
    31

    Decimal places

    I am using this formula

    =TRUNC((E3-D3)/7)&" Weeks and "&MOD(E3-D3,7)&" Days"

    to calculate date difference between two dates. It returne too many decimals, e.g.

    17 Weeks and 5.5281935185194 Days

    I've set the cell to number with no decimal but that doesn't do it.

    Thanks.

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Decimal places

    Thats because you have made it into a string.

    Use the & FORMAT(MOD(E3-D3,7) , "##.##")

    EDIT: Note by DO should be & TEXT(MOD(E3-D3,7) , "##.##")
    Last edited by rwgrietveld; 03-01-2010 at 07:26 AM.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Registered User
    Join Date
    01-17-2006
    Location
    UK
    MS-Off Ver
    Office 2016 Professional
    Posts
    31

    Talking Re: Decimal places

    Quote Originally Posted by rwgrietveld View Post
    Thats because you have made it into a string.

    Use the & FORMAT(MOD(E3-D3,7) , "##.##")

    EDIT: Note by DO should be & TEXT(MOD(E3-D3,7) , "##.##")
    Excellent! That's it, thanks very much.

+ 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