if function with rounding

G

Guest

I need to set up a function that rounds numbers up to the nearest whole
number if the decimal is greater than .5 and the number is odd, and rounds
down to the nearest whole number if the decimal is less than .5 with an odd
integer or if it is even no matter what the decimal is. Does anyone know if
there is a way to set this up?? I am trying to help out a co-worker, and I
hit a wall with this spreadsheet.

Thanks
 
B

Bob Phillips

=ROUND(A1,0)-(INT(A1/2)*2=INT(A1))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
G

Guest

the only problem is a whole number needs to stay the same

and I typed in 54 and its giving me 53
 
B

Bob Phillips

=ROUND(A1,0)-(INT(A1/2)*2=INT(A1))*(MOD(A1,1)>0)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top