+ Reply to Thread
Results 1 to 6 of 6

Format decimal to specific type of format

Hybrid View

  1. #1
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Format decimal to specific type of format

    Not clear if you want B2 to be 24.15 or 24:15 format as 24.15 - the two are very different values.

    For 24.15 as Decimal

    =DOLLARFR(A2,60)
    (DOLLARFR requires activation of Analysis ToolPak pre XL2007)

    or

    =INT(A2)+MOD(A2,1)*0.6
    If you want B2 as hours but format as though decimal then:

    =A2/24
    format as [hh].mm

  2. #2
    Forum Contributor
    Join Date
    01-26-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    162

    Re: Format decimal to specific type of format

    Hi DonckeyOte,

    Thanks for your help. I used the "INT" and "Mod" formula and it works fine however the problem that I have is when I enter a negative value it is not converting it correctly. e.g

    A2= 5.5 (converts it to 5.30) which is great
    A2= -5.5 (converts it to 5.70) which is not correct for me. It should change it to -5.30

    Can we do that please?

    Many Thanks

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Format decimal to specific type of format

    One option:

    =ROUNDDOWN(A2,0)+MOD(A2,SIGN(A2))*0.6
    assumes A2 not 0
    Last edited by DonkeyOte; 02-25-2011 at 10:03 AM. Reason: other ex. not correct

+ 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