Results 1 to 10 of 18

Thread: Roundup

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Roundup

    I need to write a formula where it rounds to the nearest whole percentage, i.e. 6.88% to 7%, or 93.12% to 93%. I then want to use that cell and the rounded percentage in future calculations. How do I tell excel to use the rounded percentage from there. HELP!

  2. #2
    You can use the Excel =round() function. It takes two arguments, one is the data you want to round and the second the number of decimal places. Since you're working with percentages you'll need two decimal places to round it off to a single percentage.

    Ie if your number is in cell A1 then you would use:

    =round(A1,2)

    Jesse

  3. #3
    Thank you, I think I got that part. Now what if I need to first take the sum of A1/A2, i.e. =SUM(A1/A2) and round the answer to the nearest whole number?

  4. #4
    Assuming that =SUM(A1/A2) returns a percentage your formula would be:

    =ROUND(SUM(A1/A2),2)

    Jesse

  5. #5
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,343
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    =ROUND(A1/A2,0)

    But... I would ask yourself if you really want to round each calculation as you go through, or only the final number. By roundind each step in the process you may find that your final number isn't as mathematically accurate... depending on your purpose of course.
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  6. #6
    Good point Ken, unless you're rounding for significant digits it should be the very last stop in the calculation. Even at that point it would be better to use number formatting to display the significance you require.

    Jesse

  7. #7
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,343
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Ha! Didn't realize that you posted as I was writing my reply.

    Bondiee, for what it's worth, I wrote the exact same formula as Jesse to start with. I removed the SUM though, as it wasn't necessary. (The computation would go in the order of operations. i.e. it would divide the two numbers, giving you one number which was then summed up.)
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •