Get decimal hours by measure type

0.5 can mean half an hour, 12 hours or noon. The measure type decides.

What you'll make

In Excel: 0.5 elapsed days becomes 12 hours.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1B8Reads the measure type for this row."Excel elapsed days"
2"Decimal hours",A8Hours already: keeps the value as it is.Not used for row 8
3"Excel elapsed days",A8*24Days: times 24 for hours.12
4"Clock-only", … A clock time: flags it, since it has no length.Not used for row 8
5SWITCH( … )Uses the part that matches the measure type.12

Read it left to right. Any other type says Review hours measure. Excel counts time in days.

=SWITCH(B8,"Decimal hours",A8,"Excel elapsed days",A8*24,"Clock-only","Review clock value has no elapsed duration","Review hours measure")

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own values. Paste each value and its measure type into the green columns of the Template tab. The types are Decimal hours, Excel elapsed days or Clock-only. The hours fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Take the measure type from the source system's field list; never guess it from the size of the number.

Microsoft's help: SWITCH function