+ Reply to Thread
Results 1 to 6 of 6

Can I make a cell round the value to the nearest whole number?

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    West Virginia, USA
    MS-Off Ver
    Excel 2000
    Posts
    31

    Can I make a cell round the value to the nearest whole number?

    I have a cell that is going to be used for the quantity of a certain item. I would like to dummy proof this sheet as much as possible so that if someone puts in 21.5, that it will do something like change the value to either 21 or 22, since there can't really be a .5 of this item.
    Last edited by Garren1013; 12-10-2012 at 04:38 PM.

  2. #2
    Registered User
    Join Date
    11-16-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Can I make a cell round the value to the nearest whole number?

    For rounding, just select Number for cell format and set it to 0 decimel places.
    Please Login or Register  to view this content.
    will give you integers as well.

    As to your other question, just use General as the cell format (assuming you don't have leading/trailing zeros that you want to keep sometimes).

  3. #3
    Registered User
    Join Date
    01-13-2010
    Location
    West Virginia, USA
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Can I make a cell round the value to the nearest whole number?

    The only problem with setting the cell format decimal is that it doesn't actually change the value. It may show as 22, but the actual value is still 21.5. I need it to round the value, not just the visual number.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Can I make a cell round the value to the nearest whole number?

    If you set the format to General, it will show the entire number as you enter it, i.e. 1.2345 or 7.65

    As you pointed out, if you format the cell to specific decimal places, Excel still holds (and uses for calculations) the entire number.
    You can set your spreadsheet to "Format as displayed" but then you permanently lose those extra digits.

    Your best bet might be entering them in 1 column (with general format) and then using the ROUND function as mentioned by JSallen in another column to round it to the proper number of decimal places.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    01-13-2010
    Location
    West Virginia, USA
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Can I make a cell round the value to the nearest whole number?

    I'm sorry for any confusion I may have made asking 2 entirely different questions in the same thread. They weren't meant for the same cell. Just ignore the everything except for the first paragraph where I want to round the value to the nearest whole number. I will try using a general cell format and see if I can use his =ROUND(#,0) suggestion.

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Can I make a cell round the value to the nearest whole number?

    Simply

    =round(a1,0)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

+ 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