View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
doc doc is offline
external usenet poster
 
Posts: 12
Default Decimal numbers in Excel

Thanks Chip,
You guys are all great!
I'm curious though, where did you come up with the "24" for the divisor??

Doc



"Chip Pearson" wrote:

You don't need to use separators. If your decimal degrees (e.g,
27.5111 = 27 deg, 30 min, 40 sec) is in D5, you can use

=INT(D5)
to get the degrees

=MINUTE(D5/24)
to get minutes

=SECOND(D5/24)
to get seconds

If you really want to separate the integral and fractional portions of
D5 into separate cells with a single formula, use the following array
formula:

={1,0}*INT(D5)+{0,-1}*(INT(D5)-D5)

Note the difference between the parens () and the curly braces {}.
Select the cells you want the integral and fractional portions to go
in, type the formula above and press CTRL SHIFT ENTER instead of
ENTER.

Since this is an Array Formula, you *must* press CTRL SHIFT ENTER
rather than just ENTER when you first enter the formula
and whenever you edit it later. If you do this properly,
Excel will display the formula in the Formula Bar enclosed
in curly braces { }. (You do not type the curly braces -
Excel includes them automatically.) The formula will not work
properly if you do not use CTRL SHIFT ENTER. See
http://www.cpearson.com/excel/ArrayFormulas.aspx for lots
more information about array formulas.

You can also use two separate formulas to get the integral and
fractional portions.

=INT(D5)
returns the integral portion

=D5-INT(D5)
returns the fractional portion

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Sat, 17 Jan 2009 13:07:01 -0800, Doc
wrote:

Is there a way to separate and use the numbers, to the left of and to the
right of the decimal point in a single cell?
I am trying to convert angles given in decimal form (i.e. 27.286°), to the
older form of degrees, minutes and seconds (i.e. 27°1710), then store the
degrees in one cell, the minutes in another cell, and the seconds in a third.
I can make it work the OTHER way with multiplication and addition, because
that doesnt require the SEPARATION of a number.