ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Roundup and rounddown function - how to combine (https://www.excelbanter.com/excel-worksheet-functions/264792-re-roundup-rounddown-function-how-combine.html)

Stefi

Roundup and rounddown function - how to combine
 
=ROUND(A1,0) follows the standard rounding rules: =1.5 up to 2

<1.5 down to 1
but if you insist on your own rounding rules then
=IF(A1<=1.5,ROUNDDOWN(A1,0),ROUNDUP(A1,0))
does that.

--
Regards!
Stefi



€˛Piotr (Peter)€¯ ezt Ć*rta:

Dear All,

I have a spreadsheet with numbers containing decimals. I would like to
combine somehow two functions so that if a number is e.g. 1.5 it should be
rounded down to 1 and if it is 1.51 it should be rounded up to 2.
How can I achieve this?

Your prompt response would be highly aprreciated.

Thanks


bala_vb

Quote:

Originally Posted by Stefi (Post 956749)
=ROUND(A1,0) follows the standard rounding rules: =1.5 up to 2

<1.5 down to 1
but if you insist on your own rounding rules then
=IF(A1<=1.5,ROUNDDOWN(A1,0),ROUNDUP(A1,0))
does that.

--
Regards!
Stefi



€˛Piotr (Peter)€¯ ezt Ć*rta:

Dear All,

I have a spreadsheet with numbers containing decimals. I would like to
combine somehow two functions so that if a number is e.g. 1.5 it should be
rounded down to 1 and if it is 1.51 it should be rounded up to 2.
How can I achieve this?

Your prompt response would be highly aprreciated.

Thanks


assuming the value exist in A1 cell i.e 1.51 and copy the formulae in B1 cell. it will work out.

=IF(LEN(A1)-FIND(".",A1,1)2,ROUNDDOWN(A1,0),IF(RIGHT(A1,FIND( ".",A1,1)+1)-0.50,ROUNDUP(A1,0),ROUNDDOWN(A1,0)))

all the best


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com