PC Review


Reply
Thread Tools Rate Thread

Custom number format

 
 
JP
Guest
Posts: n/a
 
      23rd Sep 2004
Hey all,

Does anyone know how to create the following custom number format?
56d, 5h, 4m

I have the number 56.2117988... calculated in a cell which translates to 56
days, 5 hours, and 4 minutes. I can get the cell to look like the above
format using several formulas mixed with text, but I would like to have this
remain a pure number for additional calculations.

The format dd"d", h"h", m"m" gives me 25d, 5h, 4m. I'm assuming 25 is day
of month (Feb). What is a custom number format that is total # of days, not
day of month, and yields 56d not 25d?

Thanks in advance.

Joel


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      24th Sep 2004
Could you use a helper cell:

=INT(A1)&"d, "&TEXT(A1,"h\h\, m\m")



JP wrote:
>
> Hey all,
>
> Does anyone know how to create the following custom number format?
> 56d, 5h, 4m
>
> I have the number 56.2117988... calculated in a cell which translates to 56
> days, 5 hours, and 4 minutes. I can get the cell to look like the above
> format using several formulas mixed with text, but I would like to have this
> remain a pure number for additional calculations.
>
> The format dd"d", h"h", m"m" gives me 25d, 5h, 4m. I'm assuming 25 is day
> of month (Feb). What is a custom number format that is total # of days, not
> day of month, and yields 56d not 25d?
>
> Thanks in advance.
>
> Joel


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
JP
Guest
Posts: n/a
 
      24th Sep 2004
Dave,

I actually like your solution better than my current formula:
=ROUNDDOWN(A1,0) &"d, " & HOUR(A1) & "h, " & MINUTE(A1) & "m". But it still
makes it impossible to run calculations on that cell since it includes text.

My underlying question I guess is if there is a custom format to show
elapsed days rather than just days like you can do with hours ([hh] vs hh).

Thanks for you input Dave. I'm going to update my formula with your
suggestion unless there is a way to accomplish the above.

Joel

"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Could you use a helper cell:
>
> =INT(A1)&"d, "&TEXT(A1,"h\h\, m\m")
>
>
>
> JP wrote:
> >
> > Hey all,
> >
> > Does anyone know how to create the following custom number format?
> > 56d, 5h, 4m
> >
> > I have the number 56.2117988... calculated in a cell which translates to

56
> > days, 5 hours, and 4 minutes. I can get the cell to look like the above
> > format using several formulas mixed with text, but I would like to have

this
> > remain a pure number for additional calculations.
> >
> > The format dd"d", h"h", m"m" gives me 25d, 5h, 4m. I'm assuming 25 is

day
> > of month (Feb). What is a custom number format that is total # of days,

not
> > day of month, and yields 56d not 25d?
> >
> > Thanks in advance.
> >
> > Joel

>
> --
>
> Dave Peterson
> (E-Mail Removed)



 
Reply With Quote
 
Dana DeLouis
Guest
Posts: n/a
 
      24th Sep 2004
For some reason, Microsoft only gave that formatting to vba. Don't know why
it wasn't added to the worksheet. :>(

Function DHM(n) As String
DHM = Format(n + 1, "y\d h\h N\m")
End Function

?DHM(56.2117988)
56d 5h 4m

HTH
Dana DeLouis



"JP" <jp@wrs_.com> wrote in message
news:(E-Mail Removed)...
> Dave,
>
> I actually like your solution better than my current formula:
> =ROUNDDOWN(A1,0) &"d, " & HOUR(A1) & "h, " & MINUTE(A1) & "m". But it
> still
> makes it impossible to run calculations on that cell since it includes
> text.
>
> My underlying question I guess is if there is a custom format to show
> elapsed days rather than just days like you can do with hours ([hh] vs
> hh).
>
> Thanks for you input Dave. I'm going to update my formula with your
> suggestion unless there is a way to accomplish the above.
>
> Joel
>
> "Dave Peterson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Could you use a helper cell:
>>
>> =INT(A1)&"d, "&TEXT(A1,"h\h\, m\m")
>>
>>
>>
>> JP wrote:
>> >
>> > Hey all,
>> >
>> > Does anyone know how to create the following custom number format?
>> > 56d, 5h, 4m
>> >
>> > I have the number 56.2117988... calculated in a cell which translates
>> > to

> 56
>> > days, 5 hours, and 4 minutes. I can get the cell to look like the
>> > above
>> > format using several formulas mixed with text, but I would like to have

> this
>> > remain a pure number for additional calculations.
>> >
>> > The format dd"d", h"h", m"m" gives me 25d, 5h, 4m. I'm assuming 25 is

> day
>> > of month (Feb). What is a custom number format that is total # of
>> > days,

> not
>> > day of month, and yields 56d not 25d?
>> >
>> > Thanks in advance.
>> >
>> > Joel

>>
>> --
>>
>> Dave Peterson
>> (E-Mail Removed)

>
>



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      24th Sep 2004
Someday, I'm gonna remember those differences <vbg>.

But the OP will have that same calculation problem using the UDF.

Dana DeLouis wrote:
>
> For some reason, Microsoft only gave that formatting to vba. Don't know why
> it wasn't added to the worksheet. :>(
>
> Function DHM(n) As String
> DHM = Format(n + 1, "y\d h\h N\m")
> End Function
>
> ?DHM(56.2117988)
> 56d 5h 4m
>
> HTH
> Dana DeLouis
>
> "JP" <jp@wrs_.com> wrote in message
> news:(E-Mail Removed)...
> > Dave,
> >
> > I actually like your solution better than my current formula:
> > =ROUNDDOWN(A1,0) &"d, " & HOUR(A1) & "h, " & MINUTE(A1) & "m". But it
> > still
> > makes it impossible to run calculations on that cell since it includes
> > text.
> >
> > My underlying question I guess is if there is a custom format to show
> > elapsed days rather than just days like you can do with hours ([hh] vs
> > hh).
> >
> > Thanks for you input Dave. I'm going to update my formula with your
> > suggestion unless there is a way to accomplish the above.
> >
> > Joel
> >
> > "Dave Peterson" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Could you use a helper cell:
> >>
> >> =INT(A1)&"d, "&TEXT(A1,"h\h\, m\m")
> >>
> >>
> >>
> >> JP wrote:
> >> >
> >> > Hey all,
> >> >
> >> > Does anyone know how to create the following custom number format?
> >> > 56d, 5h, 4m
> >> >
> >> > I have the number 56.2117988... calculated in a cell which translates
> >> > to

> > 56
> >> > days, 5 hours, and 4 minutes. I can get the cell to look like the
> >> > above
> >> > format using several formulas mixed with text, but I would like to have

> > this
> >> > remain a pure number for additional calculations.
> >> >
> >> > The format dd"d", h"h", m"m" gives me 25d, 5h, 4m. I'm assuming 25 is

> > day
> >> > of month (Feb). What is a custom number format that is total # of
> >> > days,

> > not
> >> > day of month, and yields 56d not 25d?
> >> >
> >> > Thanks in advance.
> >> >
> >> > Joel
> >>
> >> --
> >>
> >> Dave Peterson
> >> (E-Mail Removed)

> >
> >


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
JP
Guest
Posts: n/a
 
      24th Sep 2004
Too bad. Thanks for the input.

Joel

"Dana DeLouis" <(E-Mail Removed)> wrote in message
news:uT1$(E-Mail Removed)...
> For some reason, Microsoft only gave that formatting to vba. Don't know

why
> it wasn't added to the worksheet. :>(
>
> Function DHM(n) As String
> DHM = Format(n + 1, "y\d h\h N\m")
> End Function
>
> ?DHM(56.2117988)
> 56d 5h 4m
>
> HTH
> Dana DeLouis
>
>
>
> "JP" <jp@wrs_.com> wrote in message
> news:(E-Mail Removed)...
> > Dave,
> >
> > I actually like your solution better than my current formula:
> > =ROUNDDOWN(A1,0) &"d, " & HOUR(A1) & "h, " & MINUTE(A1) & "m". But it
> > still
> > makes it impossible to run calculations on that cell since it includes
> > text.
> >
> > My underlying question I guess is if there is a custom format to show
> > elapsed days rather than just days like you can do with hours ([hh] vs
> > hh).
> >
> > Thanks for you input Dave. I'm going to update my formula with your
> > suggestion unless there is a way to accomplish the above.
> >
> > Joel
> >
> > "Dave Peterson" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Could you use a helper cell:
> >>
> >> =INT(A1)&"d, "&TEXT(A1,"h\h\, m\m")
> >>
> >>
> >>
> >> JP wrote:
> >> >
> >> > Hey all,
> >> >
> >> > Does anyone know how to create the following custom number format?
> >> > 56d, 5h, 4m
> >> >
> >> > I have the number 56.2117988... calculated in a cell which translates
> >> > to

> > 56
> >> > days, 5 hours, and 4 minutes. I can get the cell to look like the
> >> > above
> >> > format using several formulas mixed with text, but I would like to

have
> > this
> >> > remain a pure number for additional calculations.
> >> >
> >> > The format dd"d", h"h", m"m" gives me 25d, 5h, 4m. I'm assuming 25

is
> > day
> >> > of month (Feb). What is a custom number format that is total # of
> >> > days,

> > not
> >> > day of month, and yields 56d not 25d?
> >> >
> >> > Thanks in advance.
> >> >
> >> > Joel
> >>
> >> --
> >>
> >> Dave Peterson
> >> (E-Mail Removed)

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert number to % using only custom number format challenge Brotherharry Microsoft Excel Misc 7 2nd Jun 2009 06:29 PM
Custom number format for driver's license number excel user Microsoft Excel Misc 10 16th Jul 2008 10:05 PM
Moving custom number format to NUMBER Doug Boufford Microsoft Excel Setup 3 23rd Jul 2007 11:58 PM
how do I add phone number format as a permanent custom format? frustratedagain Microsoft Excel Misc 3 4th Feb 2006 03:52 AM
Custom number format always defaults last number to 0. =?Utf-8?B?c2N1YmFkYXZl?= Microsoft Excel Misc 2 15th Jun 2005 10:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:32 AM.