Round a repeating decimal from a formula...

S

Snake2135

here's my situation: I need to round all decimals that result from an IMDIV
function to two decimal places. I have Excel 2007, I have already tried
numerous ROUND functions, formatted the cells to round to two decimal places.
But on repeating decimals it will not round, only on solid results it will
round to two decimal places, thanks in advance.
 
T

Tyro

Please explain: "But on repeating decimals it will not round, only on solid
results it will round to two decimal places". Show us an example.
What is a "solid result"? Are you saying that 1.456456456 does not round to
1.46? And that 1.456123789 does round to 1.46?

Tyro
 
S

Snake2135

By solid result I mean something that divides cleanly (not a whole number
quotient), such as 5/4 = 1.25
 
S

Snake2135

I should have elaborated better. After more screwing with it, it seems as
though no decimal will round to two places. 7/8 comes out to .875, 5/4
results 1.25 as they should, but the formula refuses to round.
 
S

Snake2135

I have tried the round function, here's an example: ROUND(IMDIV(B2,C2),2),
that just rounds to 0, and i have the cells in the column with the formulas
formatted to number and 2 decimal places. The decimal that rounds to 0 is
5/12 = .4166667....... Something like 5/2 = 2.5 rounds up to 3. I hope this
is detailed enough, thanks again.
 
T

Tyro

You still refuse to supply the underlying cell value, the rounding method
you use, if rounding with a formula, and the format you applied to the
cell.
I am not a mind reader.

Tyro
 
R

Ron Rosenfeld

here's my situation: I need to round all decimals that result from an IMDIV
function to two decimal places. I have Excel 2007, I have already tried
numerous ROUND functions, formatted the cells to round to two decimal places.
But on repeating decimals it will not round, only on solid results it will
round to two decimal places, thanks in advance.

IMDIV returns a text string, so you cannot do a ROUND on either portion
directly.

You will need to operate separately on the real and imaginary coefficients.

For example, if the result of your IMDIV operation is in A1:

=COMPLEX(ROUND(IMREAL(A1),2),ROUND(IMAGINARY(A1),2))

Obviously, in the above, you could replace A1 with your IMDIV formula.
--ron
 
S

Snake2135

Ok, here's what I am doing. I am taking the values of two cells, dividing
them with the IMDIV function and I have tried several methods to round it to
two decimal places, all of which have failed.

1. Using round coupled with the IMDIV function. EX: =ROUND(IMDIV(B2,C2),2).
This method chooses to round everything either up or down, depending if it is
greater than or less than .5 (I also have the cells formatted to 2 decimal
places)
2. Just formatting the resulting cell values to 2 decimal places yields no
rounding at all.
3. Using just round and the cells I want calculated: =ROUND(B2/C2,2) yields
the same as method 1. I have also tried using -2 instead of two with no luck.
 
T

Tyro

You still will not show me the answer you get from IMDIV(B2,C2). I give up.
Good luck.

Tyro
 
D

Dana DeLouis

Ok, here's what I am doing. I am taking the values of two cells, dividing
them with the IMDIV function and I have tried several methods to round it
to
two decimal places, all of which have failed.

Hi. The function ImDiv actually returns a String, and not a number that can
be formatted as such.

The workaround is to round both the Real & Imaginary parts, then re-join
them with Complex ( ).

[D1] =ROUND(IMREAL(C1),2)
[E1] =ROUND(IMAGINARY(C1),2)

[F1] = Complex(D1,E1)
 
R

Ron Rosenfeld

Ok, here's what I am doing. I am taking the values of two cells, dividing
them with the IMDIV function and I have tried several methods to round it
to
two decimal places, all of which have failed.

Hi. The function ImDiv actually returns a String, and not a number that can
be formatted as such.

The workaround is to round both the Real & Imaginary parts, then re-join
them with Complex ( ).

[D1] =ROUND(IMREAL(C1),2)
[E1] =ROUND(IMAGINARY(C1),2)

[F1] = Complex(D1,E1)

Basically the same answer I posted last night, but he seems to be ignoring
that.
--ron
 
D

Dana DeLouis

Oh! I see. Sorry. I was using Outlook Express, and that program always is
missing lots of posts. I switched to another News reader, and I see it
there. I've had this problem with Outlook Express for a while.
--
:>~
Dana DeLouis


Ron Rosenfeld said:
Ok, here's what I am doing. I am taking the values of two cells,
dividing
them with the IMDIV function and I have tried several methods to round
it
to
two decimal places, all of which have failed.

Hi. The function ImDiv actually returns a String, and not a number that
can
be formatted as such.

The workaround is to round both the Real & Imaginary parts, then re-join
them with Complex ( ).

[D1] =ROUND(IMREAL(C1),2)
[E1] =ROUND(IMAGINARY(C1),2)

[F1] = Complex(D1,E1)

Basically the same answer I posted last night, but he seems to be ignoring
that.
--ron
 
R

Ron Rosenfeld

Oh! I see. Sorry. I was using Outlook Express, and that program always is
missing lots of posts. I switched to another News reader, and I see it
there. I've had this problem with Outlook Express for a while.

That's interesting.

I had been using Forte Agent 1.93 and some of my posts did not appear on the
Microsoft newsgroup Web View. That was a very old version so I just upgraded
to 4.1. I checked that my earlier post in this thread was on the web view.

But clearly there is something strange going on here.

The OP's newsreader is listed as:

X-Newsreader: Microsoft CDO for Windows 2000

but I don't know what that means in this context.

Maybe he just didn't see my post, for one reason or another, but will see
yours.
--ron
 

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