Formatting Issues

How to Create a Custom Excel Format for Hours and Minutes

Nimra MalikNimra Malik Oct 22, 2026 868 views

Question details

The user wants to format decimal-style time values (like 48.37) into a specific hours and minutes format (like 48h 37m) and apply this custom format across multiple rows.

How to Create a Custom Excel Format for Hours and Minutes
Product
Spreadsheet
Device & OS
not provided
Scenario
Organizing or calculating time logs where durations are inputted as decimals but need to be displayed as exact elapsed hours and minutes.
Observed behavior
The current data displays as standard decimals (48.37) instead of the desired time layout (48h 37m), requiring a batch-applicable custom cell format.
Before you start

Ensure your time data is entered consistently. If your values are currently plain text or standard decimals rather than true time values, you must convert them into a valid time format before applying the custom display layout.

Solution 1Recommended

Apply a Custom Time Format to Multiple Cells

Use the 'Format Cells' feature to create a reusable custom display layout for true time values, showing them as hours and minutes across your selected rows.

By defining a custom number format, you change how the data looks without altering the underlying value, ensuring calculations still work correctly.

1
Select your data

Highlight all the rows, columns, or specific cells containing the time values you want to format.

2
Open Format Cells

Right-click the highlighted area and choose 'Format Cells' from the context menu, or press the Ctrl+1 shortcut on your keyboard.

3
Navigate to Custom

In the Format Cells dialog box, go to the 'Number' tab and select 'Custom' from the Category list on the left side.

4
Enter the custom code

In the 'Type' input field, delete the default text and enter the exact custom format code: [h]"h "mm"m"

5
Apply and reuse

Click 'OK' to apply the new format. Your values will now display as hours and minutes. This format is saved in the Custom list for the current workbook, so you can easily reuse it for other cells later.

Apply a Custom Time Format to Multiple Cells
Using Bracketed Hours: Using [h] instead of h in your format code ensures that total elapsed time over 24 hours displays properly without resetting the clock to zero.
Efficient Data Formatting

Quickly Format Time Data with WPS Spreadsheet

WPS Spreadsheet makes complex data formatting effortless. You can quickly define, batch-apply, and reuse custom time formats across hundreds of rows in seconds.

  1. 1. Open Data: Launch WPS Spreadsheet and open your workbook containing the time logs.
  2. 2. Select Range: Highlight the columns or specific cells you need to adjust.
  3. 3. Access Custom Formatting: Press Ctrl+1 to instantly open the Format Cells window.
  4. 4. Apply Code: Click 'Custom', type your hours and minutes format code, and hit OK.
Easily create custom time formats like [h]"h "mm"m"Fully compatible with Microsoft Excel cell formatting and formulasLightweight, incredibly fast, and free to use for daily data tasks
QA img-9

Frequently Asked Questions

Why does my formatted time reset to zero after 24 hours?

If you use the standard 'h' format, the system assumes it is a clock time and resets every 24 hours. To display cumulative elapsed hours beyond 24, you must wrap the 'h' in square brackets, writing it as '[h]' in your custom format code.

How do I apply my new custom format to other sheets?

Once you create a custom format in a workbook, it is automatically saved at the bottom of the 'Custom' category list. You can simply select the new cells, open the Format Cells dialog, and select it from the list without typing it out again.

Can I calculate the total of these formatted time cells?

Yes. Custom formatting only changes how the data is visually displayed. The underlying numeric values remain perfectly intact, meaning you can still use the SUM function and other formulas normally.