Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Gerry Wilkins
 
Posts: n/a
Default specific rounding of formulas which may need to include an IF stat

I am currently working on a worksheet where i would like to round the value
in a cell (the cells currently contain a formula which has been rounded to 0
decimal places). The rule being that if the last digit (before the decimal
place) is the number 0, 1,2,3 or 4 then round up the last digit to the digit
5. If the number is 5,6,7,8 or 9 then round up the last digit to 9. I would
like to know how to write this formula.

For example
if the value is 493.75 then round up to 495.
if the value is 498.75 then round up to 499.
if the value is 1233.75 then round up to 1235.
if the value is 1238.75 then round up to 1239.
  #3   Report Post  
Ola
 
Posts: n/a
Default

Hi,

Here is one solution:
=IF((A1-TRUNC(A1/10,0)*10)<5,5,9)+TRUNC(A1/10,0)*10

Ola

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculating formulas for all workbooks in a folder Chad Excel Worksheet Functions 3 November 13th 04 05:22 PM


All times are GMT +1. The time now is 12:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"