+ Reply to Thread
Results 1 to 9 of 9

Excel 2007 : Round to integer ending in 5

  1. #1
    Registered User
    Join Date
    03-17-2011
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Round to integer ending in 5

    I'm trying to figure out how to get my results to round to the closest integer ending in 5.
    Example: 550.33 would round to 555, 367.2 would round to 365.
    I've tried all sorts of round and mround equations and they all round to the nearest multiple of 5. I'm stumped on this one.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Round to integer ending in 5

    I would use this:

    =MROUND(A1 + 5, 10) - 5


    NOTE: Go to Tools > Addins and make sure the Analysis Toolpak is enabled.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,433

    Re: Round to integer ending in 5

    Try:

    =((INT(A1/10))*10)+5

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    03-17-2011
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Round to integer ending in 5

    Thanks so much. The MROUND was easier to type out so I used that one.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,433

    Re: Round to integer ending in 5

    =5+INT(A1/10)*10

    Any easier? And you don't need the Analysis Pack ... which might be a factor if others have to use the workbook.

    Regards

  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

    Re: Round to integer ending in 5

    An advantage of TM's INT formula is that it works for both positive and negative numbers without modification.
    Entia non sunt multiplicanda sine necessitate

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

    Re: Round to integer ending in 5

    You could also use ROUND

    =ROUND(A1+5,-1)-5
    Audere est facere

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Round to integer ending in 5

    Good catch, SHG. If negative numbers are a possibility, use TMShucks. Mine would have to change to this to work for pos/neg numbers:

    =(MROUND(ABS(C17)+5,10)-5)*SIGN(C17)


    EDIT: DLL wins again! Nicely simple and I learned something, I never knew you could -1 the second ROUND() param.
    Last edited by JBeaucaire; 03-17-2011 at 07:26 PM.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Round to integer ending in 5

    Quote Originally Posted by daddylonglegs View Post
    You could also use ROUND

    =ROUND(A1+5,-1)-5
    Yup. And that has the additional advantage of being symmetric about 0:

    Please Login or Register  to view this content.

+ 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