+ Reply to Thread
Results 1 to 14 of 14

Round Function

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-14-2009
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    129

    Round Function

    Hello,

    I have recently taken on a new role, and it involves using a lot of Spreadsheets set up by my predecessor. The problem I have is that he never used the Round,2 function and as a result i get a lot of "false" returns when using the information as the results are e.g. 13.000001. I can use a ctrl shift 1 to make it look correct to 2dp, but is there a way of mass formatting the spreadsheet to give results in 2DP.

    Any help would be appreciated.

    R's

    Om

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Round Function

    Without a excel file, without confidential information, it's hard to tell.

    Please also add the desired result in your file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    04-14-2009
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Round Function

    Please find attached example
    Attached Files Attached Files

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,508

    Re: Round Function

    for me the simplistic way I'd do it is just format the cell you want then use the format painter, double click on it and then highlight all the areas you want as 2 decimal places and you'll have it.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Contributor
    Join Date
    04-14-2009
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Round Function

    Wont that just make it look like two decimal places without changing it?

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,455

    Re: Round Function


  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,508

    Re: Round Function

    Guess I misunderstood because you mentioned formatting in the first post so I went with a formatting answer.

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Round Function

    Try this on your sheet

    =IFERROR(1/(1/IF(MOD(B4,1)=0,B4,TRUNC(B4,2))),"")

    H
    I
    J
    K
    4
    2306
    2456
    2414
    2111
    5
    6
    2121
    2541
    2124
    1875
    7
    42.42
    50.82
    42.48
    37.5
    8
    82.71
    99.09
    82.83
    73.12
    9
    121.32
    145.34
    121.49
    107.25
    10
    53.66
    64.28
    53.73
    47.43
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  9. #9
    Forum Contributor
    Join Date
    04-14-2009
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Round Function

    Where would I type that?

  10. #10
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Round Function

    Quote Originally Posted by AlKey View Post
    Try this on your sheet
    =IFERROR(1/(1/IF(MOD(B4,1)=0,B4,TRUNC(B4,2))),"")
    Quote Originally Posted by omletto View Post
    Where would I type that?
    Why would you even consider it?

    First, it truncates; it does not round, as you requested. For example, if B4 is 42.415, the formula converts it 42.41 instead of rounding to 42.42.

    Second, the formula has the potential for converting perfectly good integers to values that are infinitesimally different, which can screw up some dependent calculations. For example, if B4 is 3306 and the formula is in C4, then MATCH(3306,C4,0) returns #N/A (no match), and IF(B4-C4=0,TRUE) returns FALSE.

    (Caveat: But IF(B4=C4,TRUE) returns TRUE(!), and =B4-C4 returns exactly zero(!). This is due to a dubious and inconsistent heuristic that allows Excel to treat some values as equal when, in fact, they are not.)

    Frankly, it's the most baroque "solution" I've ever seen. Why not simply write =ROUND(B4,2)?
    Last edited by joeu2004; 07-07-2014 at 12:02 PM.

  11. #11
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Round Function

    On your example in H4

    You can use this smaller version

    =IFERROR(1/(1/TRUNC(B4,2)),"")

  12. #12
    Forum Contributor
    Join Date
    04-14-2009
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Round Function

    I would then be creating a duplicate set of data, I was hoping to change the original data.

  13. #13
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Round Function

    Quote Originally Posted by omletto View Post
    I would then be creating a duplicate set of data, I was hoping to change the original data.
    This is an example! If you need to use with your calculations then just put your calculations in formula instead of cell reference.

    =IFERROR(1/(1/TRUNC(B6*2%,2)),"")

  14. #14
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Round Function

    Quote Originally Posted by omletto View Post
    I have recently taken on a new role, and it involves using a lot of Spreadsheets set up by my predecessor. The problem I have is that he never used the Round,2 function and as a result i get a lot of "false" returns when using the information as the results are e.g. 13.000001. I can use a ctrl shift 1 to make it look correct to 2dp, but is there a way of mass formatting the spreadsheet to give results in 2DP.
    Yes, but I do not recommend it. Before trying anything, be sure to make a backup copy of the file.

    You can set the calculation option "Precision as displayed" (PAD).

    First, be sure the cells are formatted with 2 decimal places.

    Then, in Excel 2010, click on File, Options, Advanced, then page down until you see the option, and select it.

    One problem with PAD is: its effect is pervasive and indiscriminatory. For example, if you calculate a daily interest rate in a cell, and you format it to display 4 percentage decimal places (i.e. 6 decimal places numerically), when you set PAD, the actual value of the cell will be rounded to 4 pdp. And that will impact all subsequent calculations.

    Normally, deselecting PAD or reformatting with more decimal places corrects such unintended conversions.

    However, the biggest danger of PAD is: such conversions of constants are irreversible.

    Another problem with PAD is: it only affects the final value of a cell. It does not affect subexpressions. For example, IF(10.1 - 10 = 0.1, TRUE) still returns FALSE(!). We still must correct such problems by explicitly rounding, i.e.
    IF(ROUND(10.1 - 10, 2) = 0.1, TRUE).

    There are many more issues with PAD. That is why I do not recommend its use.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] If Statement with a Divisible-By function and Round Function
    By thanhie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-06-2013, 01:00 AM
  2. [SOLVED] Conditional Round up or Round up Function
    By cdmterence in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-18-2013, 06:03 PM
  3. Problem Inserting Round function into an IF function
    By Ash87 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-11-2013, 05:37 PM
  4. [SOLVED] VB Function Round vs Excel function Round not behaving the same Od
    By Bud in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-18-2006, 12:45 AM
  5. [SOLVED] The ROUND function
    By Louise in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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