+ Reply to Thread
Results 1 to 13 of 13

help with 32nd rounding

  1. #1
    Forum Contributor
    Join Date
    06-24-2008
    MS-Off Ver
    2007
    Posts
    139

    help with 32nd rounding

    I need help with a custom number format.
    The numbers in the worksheet read like this: 114'31.5
    The number behind the hyphen are not to exceed 32, after 32 they become a full point (115'00.0). Thanks for the help in advance!
    Last edited by mudraker; 06-24-2008 at 10:07 PM. Reason: Change thread title

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    novice2430

    Welcome to Exceltip forum

    Please take a couple of minutes and read the Forum Rules then edit your thread title by following the instructions in the rules (Rule 1)
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Contributor
    Join Date
    06-24-2008
    MS-Off Ver
    2007
    Posts
    139
    Anyone have an answer?

  4. #4
    Registered User
    Join Date
    06-24-2008
    Location
    Cambridge UK
    Posts
    53
    I don't understand what you are trying to do. Do you want the user to enter a value that is then converted into this format? Or do you want to change a list of decimal numbers to this format? Or change from this format to binary? Or what?

  5. #5
    Forum Contributor
    Join Date
    06-24-2008
    MS-Off Ver
    2007
    Posts
    139
    Sorry for not being clear.

    I want the user to be able to enter a value and then it's converted into this format. I also need the number in front of the ' to round up 1 when the number behind the ' goes over 32.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    You can't do it with formatting, but you can use a formula that displays a number entered in another cell in that fashion:

    =INT(A1) & "'" & TEXT( ROUND( (A1 - INT(A1)) * 64, 0) / 2, "00.0")

    For example,
    Please Login or Register  to view this content.
    Last edited by shg; 06-29-2008 at 01:45 PM.

  7. #7
    Forum Contributor
    Join Date
    06-24-2008
    MS-Off Ver
    2007
    Posts
    139
    Almost there!

    The number in column "B" is how I need the number to appear, however the rounding is off.

    Once the number behind the ( ' )goes over 32 I need the number to the left of the ( ') to increase by 1.

    For example, using the sam numbers you used:

    --A--- ---B----
    1 953.78 955'04.0
    2 651.28 651'28.0
    3 123.59 124'27.0
    4 347.24 347'24.0
    5 6.71 8'07.0

    In the formula you supplied I notice the 64, is that how this formula rounds? I need 32nd rounding after the (').


    Quote Originally Posted by shg
    You can't do it with formatting, but you can use a formula that displays a number entered in another cell in that fashion:

    =INT(A1) & "'" & TEXT( ROUND( (A1 - INT(A1)) * 64, 0) / 2, "00.0")

    For example,
    Please Login or Register  to view this content.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,694
    Try

    =INT(A1)+INT(MOD(A1,1)/0.32)&TEXT(MOD(MOD(A1,1)*100,32),"'00.0")

  9. #9
    Forum Contributor
    Join Date
    06-24-2008
    MS-Off Ver
    2007
    Posts
    139
    one last question,
    is it possible to add the formula to a cell that already has a value in it?
    I have 113255 in cell B3, I need this formula to turn that number in B3 to 113'25.5

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,694
    To do that you'd need to use VBA, I believe. Not really my field........

    BTW if B3 rounds to 113'25.5 then are you rounding in that case to the 1/64?

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    For whatever reason, I assumed the digit past the decimal should always be 0 or 5 ...

    =INT(A1) & "'" & TEXT( (A1 - INT(A1)) * 32, 0), "00.0")

    Please Login or Register  to view this content.

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    You could format the cell as ###"'"00"."0 and it would appear as you wish, but computationally it would still be the original number.

  13. #13
    Forum Contributor
    Join Date
    06-24-2008
    MS-Off Ver
    2007
    Posts
    139
    Oh okay,
    thanks for all the help you two have given me!

+ 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