Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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????

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Split a decimal figure Jaleel Excel Discussion (Misc queries) 10 August 27th 08 03:12 AM
How to split numbers and decimal in 2 columns yodochi New Users to Excel 2 July 23rd 07 10:59 PM
Split number with decimal places into 2 columns meridklt New Users to Excel 3 May 3rd 07 12:00 AM
Converting 2-place decimal value to floating point decimal number with leading zero Kermit Piper Excel Discussion (Misc queries) 3 March 18th 06 06:20 PM
how to split one decimal pt integer off & to next columnin excel? Roger Knights Excel Discussion (Misc queries) 3 October 27th 05 12:10 AM


All times are GMT +1. The time now is 01:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"