Split a decimal number

M

martin.a.john

Does anyone know of a way to split a decimal number????

I have found a way in a program I am writing to reference cells in a
second sheets by dividing the rown number in the current sheet by 5
i.e. if the row number in the current sheet is 1 then 1/5=0.2.
Therefore on the second sheet that item will be pasted on the first
row (indexed by 0) and two colums accross (indexed by 2).

So to come back to my question is there a way to get the right part of
the decimal and left part of the decimal. So that:

index accross = decimal value
index down = whole number


I have thought about the left function however this will go upto 1000
entries (therefore left,4 = 0.2) so this will not work :(

Thanks in advance,

Martin
 
M

merjet

Suppose cell A1 contains a number.

Then =INT(A1) gives the integer part, and =A1-INT(A1) gives the
fraction part.

Hth,
Merjet
 
M

martin.a.john

One way:

Integer part: =INT(A1)
Fractional Part: =MOD(A1,1)

both of these work really well. Thanks.

I decided to use the =Int(a1) and for the decimal part = right, 1, as
there is always 1 decimal place in all instances. I can see how the
others can be used to get around limitations of this tho.

Thanks again,

Great help.
 

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