ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Split a decimal number (https://www.excelbanter.com/excel-programming/389355-split-decimal-number.html)

[email protected]

Split a decimal number
 
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


merjet

Split a decimal number
 
Suppose cell A1 contains a number.

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

Hth,
Merjet



JE McGimpsey

Split a decimal number
 
One way:

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

In article .com,
" wrote:

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


[email protected]

Split a decimal number
 
On 14 May, 18:17, JE McGimpsey wrote:
One way:

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

In article .com,

" wrote:
Does anyone know of a way to split a decimal number????


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.



All times are GMT +1. The time now is 10:34 AM.

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