• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Formula

dhananjay

New Member
How we can truncate 13.5 into 13 but 13.6 (when integer part is odd)into 14 but when it is (when integer part is even)14.5 it will be 15 and similarly for every odd and integer part
 
Good day dhananjay sounds like you need the round function:-

[pre]
Code:
=ROUNDUP(150.255,0) 151 The second argument is 0.
The result is rounded up to the
next higher integer, regardless
of the fact that the decimal
portion would normally indicate
the rounding would go to
the next lower integer.
=ROUNDUP(150.255,1) 150.3 The second argument is 1. The

result is rounded to a single

decimal point. Note that the

full decimal of .255 rounds up

to.3. This would also happen

with the standard ROUND

function.

[pre][code]=ROUNDUP(150.255,2) 150.26 The second argument is 2; the
result is rounded to two decimal
places. Note that the full
decimal of .255 becomes .26.
This would also happen with
the standard ROUND function.
[/pre]
=ROUNDUP(150.255,3) 150.255 The second argument is 3,

and there are three decimal

places. No rounding takes

place.

=ROUNDDOWN(155.798,0) 155 The second argument is 0.
The result is rounded down
to the integer portion of the
number, regardless of the fact
that the decimal portion would
normally indicate that the
rounding would go to the next
higher integer.[/code][/pre]
=ROUNDDOWN(155.798,1) 155.7 The second argument is 1. The

result is rounded to a single

decimal place. Note that the

full decimal of .798 rounds

down to .7. The standard

ROUND function would round

the decimal up to .8.
 
Hi Dhananjay ,


Try this :


=IF(AND(ISODD(INT(A1)),MOD(A1,1)<=0.5),ROUNDDOWN(A1,0),ROUND(A1,0))


where your number is in A1.


Narayan
 
Back
Top