JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,535
- Office Version
- 365
- Platform
- Windows
I would like to be able to format a time value so that it is displayed in the smallest units that are less than "1" of the next larger unit. That is, use seconds up to 1 minute, then minutes up to 1 hour, hours up to 1 day, etc. I would also like to be able to specify the number of decimal points to display, which complicates things.
Here are some examples:
<tbody>
</tbody>
I started writing a UDF, but it quickly got complicated. Is there an easy way to do this?
If not, I'll post my UDF if I ever get it working.
Here are some examples:
C/R | A | B | C | D |
1 | Value | Units | DP | Result |
2 | 1.75 | sec | 0 | 2 secs |
3 | 1.75 | sec | 1 | 1.8 secs |
4 | 59.49 | sec | 1 | 59.5 secs |
5 | 59.50 | sec | 1 | 59.5 secs |
6 | 59.50 | sec | 0 | 1 mins |
7 | 59.95 | sec | 2 | 59.95 secs |
8 | 59.95 | sec | 1 | 1 mins |
9 | 23.49 | hour | 1 | 23.5 hours |
10 | 23.49 | hour | 0 | 23 hours |
11 | 23.50 | hour | 1 | 23.5 hours |
12 | 23.50 | hour | 0 | 1 days |
<tbody>
</tbody>
I started writing a UDF, but it quickly got complicated. Is there an easy way to do this?
If not, I'll post my UDF if I ever get it working.