Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default How to break apart a Decimal formatted number?

I am trying to find a way to break up a Decimal formatted number into parts...
(Degrees to Decimal and then Decimal to Degrees)
Here's what I'm attempting...

cell F2 has 139.4916667 and I am trying to get the whole number (139) into
the adjacent cell G2. Using whole number rounding (formatted) works fine but
if the decimal places carry over.5 then it rounds up (139.50124 would be 140
not what I desire) I would like to break it apart to do the following:

cell F2 is 139.4916667
cell G2 would show the whole number 139 (even if F2 was 139.99999-no
rounding up)
cell H2 would take the remainder of the decimal portion (.4916667 and
multiply it by 60...then the whole number from this would be displayed in H2
(29.500002 would be 29 again no rounding up)
lastly in cell I2 the remainder of the last calculation .500002 would be
multiplied by 60 and entered as the number it is decimal formatted 30.00012

I have tried to use the Degrees to Decimal and the Decimal to Degrees VB
code (from MS website) for this but it requires that the user needs to enter
it into the "fx" area and I'm trying keep this worksheet in a "cell" entry
format for our personnel so they aren't confused by it (keep them in the cell
entry area not going up to the function entry text area).

Any help is always appreciated...Thanks


--
jgbadingerjr
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to break apart a Decimal formatted number?

On Tue, 27 Mar 2007 18:04:21 -0700, jgbadingerjr
wrote:

I am trying to find a way to break up a Decimal formatted number into parts...
(Degrees to Decimal and then Decimal to Degrees)
Here's what I'm attempting...

cell F2 has 139.4916667 and I am trying to get the whole number (139) into
the adjacent cell G2. Using whole number rounding (formatted) works fine but
if the decimal places carry over.5 then it rounds up (139.50124 would be 140
not what I desire) I would like to break it apart to do the following:

cell F2 is 139.4916667
cell G2 would show the whole number 139 (even if F2 was 139.99999-no
rounding up)
cell H2 would take the remainder of the decimal portion (.4916667 and
multiply it by 60...then the whole number from this would be displayed in H2
(29.500002 would be 29 again no rounding up)
lastly in cell I2 the remainder of the last calculation .500002 would be
multiplied by 60 and entered as the number it is decimal formatted 30.00012

I have tried to use the Degrees to Decimal and the Decimal to Degrees VB
code (from MS website) for this but it requires that the user needs to enter
it into the "fx" area and I'm trying keep this worksheet in a "cell" entry
format for our personnel so they aren't confused by it (keep them in the cell
entry area not going up to the function entry text area).

Any help is always appreciated...Thanks


G2: =INT(F2)
H2: =INT(MOD(F2,1)*60)
I2 =INT(MOD(MOD(F2,1)*60,1)*60)


--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default How to break apart a Decimal formatted number?

=ROUNDDOWN(F2,0)
=60*(F2-G2)
=60*(H2-ROUNDDOWN(H2,0))


In G2, H2, I2
--
Gary''s Student
gsnu200712

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
How to break apart a Decimal formatted number? jgbadingerjr Excel Discussion (Misc queries) 0 March 28th 07 01:54 AM
Why is a cell formatted as a zip code is showing up as a decimal? Renee' Excel Discussion (Misc queries) 4 February 14th 07 12:30 PM
Copying the number of a custom formatted number cell fbvideo Excel Discussion (Misc queries) 2 January 25th 07 11:00 PM
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 convert a decimal number to a non-decimal number? snickers22 Excel Worksheet Functions 4 January 13th 05 10:04 PM


All times are GMT +1. The time now is 06:02 AM.

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"