Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am already using a custom date format of d:h:mm for a field where I am
calculating the networkdays from one date & time to another. I want to be able to add these fields, however, if it exceeds 31 days it does not maintain the number of days but starts over. How can I build a custom format to recognize the total number of days? I have tried to put bracket around the number of days to show as [d]:h:mm but it does not work. Any help would be appreciated! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
This is a rather unusual format d:h:mm, what do you want the results to look like, give us an example. d stands for single digit days and runs from 1 to 31 (the number of days in a month). I don't think you can create a format which does exactly what you want, but you can create a formula in a cell which display the way you want. =INT(C4)&":"&TEXT(MOD(C4,1),"hh:mm") where C4 is you cell you wanted to format. -- If this helps, please click the Yes button. Cheers, Shane Devenshire "Lori B" wrote: I am already using a custom date format of d:h:mm for a field where I am calculating the networkdays from one date & time to another. I want to be able to add these fields, however, if it exceeds 31 days it does not maintain the number of days but starts over. How can I build a custom format to recognize the total number of days? I have tried to put bracket around the number of days to show as [d]:h:mm but it does not work. Any help would be appreciated! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Wed, 4 Mar 2009 08:13:02 -0800, Lori B
wrote: Here is an example. Cell d3 I have 02/02/2009 9:54. In cell D2 I have 02/09/2009 13:50. I have the time split out from each of those cells into cell H2 (13:50) & h3 (9:54). My formula is =networkdays(d3,d2,Lookup!$D:$D)-1+(h2-h3). I don't want to count the first day so I have -1 in my formula to not include that. My results show in the format of d:h:mm and for my example above would be 5:3:56. 5 days, 3 hours, & 56 minutes. I use this to calculate the amount of time a job was in a department. I then want to add up the total time of all jobs in that one department. Does this help? Maybe I should be using a different format to display the amount of time calculated per job? Thanks for your help That clarifies things. As far as I know, you won't be able to have both the format you want, and also be able to use the result for math operations. I would suggest that you either express your result as days and fraction of a day, perhaps with a limited number of decimal places, or use a separate column to display the results as text. Your formula, in days, and fractions of a day, shows: 5.163888889 If that value is in, for example, G3, then: =INT(G3)&TEXT(MOD(G3,1),":h:m") would display your result in your preferred format. But you'll only be able to do math operations on the value in G3. You could also display the result as: =INT(G3) & TEXT(MOD(G3,1),""" days, ""h"" hours, ""m"" minutes""") which would be unambiguous to the casual perusor of the sheet. --ron |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
this helps. Thanks!!!
"Ron Rosenfeld" wrote: On Wed, 4 Mar 2009 08:13:02 -0800, Lori B wrote: Here is an example. Cell d3 I have 02/02/2009 9:54. In cell D2 I have 02/09/2009 13:50. I have the time split out from each of those cells into cell H2 (13:50) & h3 (9:54). My formula is =networkdays(d3,d2,Lookup!$D:$D)-1+(h2-h3). I don't want to count the first day so I have -1 in my formula to not include that. My results show in the format of d:h:mm and for my example above would be 5:3:56. 5 days, 3 hours, & 56 minutes. I use this to calculate the amount of time a job was in a department. I then want to add up the total time of all jobs in that one department. Does this help? Maybe I should be using a different format to display the amount of time calculated per job? Thanks for your help That clarifies things. As far as I know, you won't be able to have both the format you want, and also be able to use the result for math operations. I would suggest that you either express your result as days and fraction of a day, perhaps with a limited number of decimal places, or use a separate column to display the results as text. Your formula, in days, and fractions of a day, shows: 5.163888889 If that value is in, for example, G3, then: =INT(G3)&TEXT(MOD(G3,1),":h:m") would display your result in your preferred format. But you'll only be able to do math operations on the value in G3. You could also display the result as: =INT(G3) & TEXT(MOD(G3,1),""" days, ""h"" hours, ""m"" minutes""") which would be unambiguous to the casual perusor of the sheet. --ron |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Wed, 4 Mar 2009 10:21:03 -0800, Lori B
wrote: this helps. Thanks!!! You're welcome. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom Date Format | Excel Discussion (Misc queries) | |||
Date format defaults to Custom | Excel Discussion (Misc queries) | |||
Looking for custom date format | Excel Worksheet Functions | |||
Custom format date | New Users to Excel | |||
Custom Date format ie. 01.01.05 W1 (W1 is week 1) | Excel Discussion (Misc queries) |