- Select the cell or range of cells that you want to format.
- Right-click and select "Format Cells" or go to the "Home" tab and click on the "Number Format" dropdown.
- In the Format Cells dialog box, select the "Custom" category.
- In the "Type" field, enter one of the following formats:
For 24-hour time:
- hh:mm:ss
- [h]:mm:ss
For 12-hour time with AM/PM:
- h:mm:ss AM/PM
- h:mm:ss.0 AM/PM
- Click "OK" to apply the format to the selected cells.