Convert Decimal (Person Days) to Time in Excel

What?
We have an excel spreadsheet which reports against a mySQL database and reads time spent on projects by IT Service colleagues. The main report is a pivot table with staff members along the top, tasks down the first column, and time spent in the form of person days in the cross-join.

Why?
Currently the smallest bookable time by low-level tape monkeys and techies is 30 minutes (Managers it would appear can book whatever time, eg. 5mins). 30 minutes for us translates to 0.07 in person days (a person day being 7 hours and 24 minutes or 26640 seconds).

How?
The answer was always going to be a convoluted formula just to convert it into minutes and then format the resulting value into a custom format of [h]:mm:ss
copyraw
-- Aim / Objective:

ColumnA     ColumnB     ColumnC
----------  ----------  -----------
Task 1      0.14        1:00:00 
Task 2      0.07        0:30:00 
Task 3      4.80        34:15:00
  1.  -- Aim / Objective: 
  2.   
  3.  ColumnA     ColumnB     ColumnC 
  4.  ----------  ----------  ----------- 
  5.  Task 1      0.14        1:00:00 
  6.  Task 2      0.07        0:30:00 
  7.  Task 3      4.80        34:15:00 

Excel needs the decimal number to be representative of a 24 hour slot. In other words, 1.0 in decimal, formatted to time is equal to 24 hours; 0.5 would be 12 hours and so forth. My formula:
copyraw
-- Given Cell B5 = 0.14 person days from above example.
-- 1 person day = 26640 seconds and 1440 minutes = 24 hours.
-- 0.07 person days = 30 minutes or 0.14 person days = 1 hour.

0.04166667 =(ROUND(B5/0.07, 0)*30)/1440       -- now format to [h]:mm:ss
-- yields 1:00:00

0.04166667 =(ROUND(B5/0.07, 0)*0.5)/24        -- now format to [h]:mm:ss
-- yields 1:00:00
  1.  -- Given Cell B5 = 0.14 person days from above example. 
  2.  -- 1 person day = 26640 seconds and 1440 minutes = 24 hours. 
  3.  -- 0.07 person days = 30 minutes or 0.14 person days = 1 hour. 
  4.   
  5.  0.04166667 =(ROUND(B5/0.07, 0)*30)/1440       -- now format to [h]:mm:ss 
  6.  -- yields 1:00:00 
  7.   
  8.  0.04166667 =(ROUND(B5/0.07, 0)*0.5)/24        -- now format to [h]:mm:ss 
  9.  -- yields 1:00:00 
Note that the first formula is converting person days into minutes and then dividing by 1440 (resulting in the decimal number: 0.04166667 - 1 hour of a 24 hour slot or 1/24), you then right-click and format it to time and it should match the results above.

The second formula is converting person days into hours and then dividing by 24 (which should return the same decimal number).

Category: Excel :: Article: 486

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Related Articles

Joes Revolver Map

Joes Word Cloud

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.