How to Convert Time to Number in Excel (5 Easy Methods)

Suppose you have a list of time ranges. It contains the Times to Convert into Numbers.

Convert Time to Number in Excel


Method 1 – Using Format Cells Option to Convert Time to Number in Excel

Let’s convert the times to the fraction of the day they represent.

Convert Time to Number in Excel Using Format Cells Option

Steps

  • Create a new column in the C4:C12 range.
  • Copy cells in the C5:C12 range by pressing CTRL+C.

Convert Time to Number in Excel Using Format Cells Option

  • Paste these into cell C5 with Ctrl + V.

Convert Time to Number in Excel Using Format Cells Option

  • Go to the Home tab.
  • Select the Number group.
  • Click on the drop-down arrow in the Number Format box.
  • Choose the General format from the list.

Convert Time to Number in Excel Using Format Cells Option

  • The times are showing as number values.

Convert Time to Number in Excel Using Format Cells Option

We can reduce the number of decimal digits to make it look nicer:

  • Select cells in the C5:C12 range.
  • Go to the Home tab.
  • Select the Number group.
  • Click several times on the Decrease Decimal icon until you get your desired digits after the decimal.

Convert Time to Number in Excel Using Format Cells Option

  • We converted the times into numbers.

Convert Time to Number in Excel Using Format Cells Option

Read More: How to Convert Time to Decimal in Excel


Method 2 – Applying Excel TIMEVALUE Function to Convert Time to Number

We can also convert text values that represent time into numbers.

Convert Time to Number in Excel Using TIMEVALUE Function

Steps

  • Select cell C5.
  • Write down the formula below and press Enter.
=TEXT(B5,"H:MM:ss")

In this formula, we used the TEXT function to convert the time in cell B5 into a text string.

Convert Time to Number in Excel Using TIMEVALUE Function

  • Use the Fill Handle tool to copy the formula into the remaining cells.

Convert Time to Number in Excel Using TIMEVALUE Function

  • Select cell D5 and type in the formula below.
  • Press the Enter key.
=TIMEVALUE(C5)

Here, C5 represents the text string 8:45:12 in cell C5.
Hence, we used the TIMEVALUE function here. This function takes a text string as input. Then, it returns the text string as a representation of time in decimal number format. The decimal value ranges from 0 to 0.99988426, which corresponds to the times between 0:00:00 (12:00:00 AM) and 23:59:59 (11:59:59 PM).

Convert Time to Number in Excel Using TIMEVALUE Function

  • The numbers look like the one below.

Convert Time to Number in Excel Using TIMEVALUE Function

Read More: Convert Time to Text in Excel


Method 3 – Applying Simple Arithmetic Formula to Convert Time to Number

Let’s break down the time into how many hours, minutes, or seconds passed since midnight.

Convert Time to Number in Excel Applying Simple Arithmetic Formula

Steps

  • Select cell C6.
  • Write down the formula below and press Enter:
=B6*24

Here, B6 serves as the cell reference for the first Time in the list. In formula above, we multiplied B6 by 24 as this is the number of hours in a day.

Convert Time to Number in Excel Applying Simple Arithmetic Formula

  • Go to the Home tab.
  • Select the Number group.
  • Click on the down arrow in the Number Format box.
  • Choose the Number format from the list.

Convert Time to Number in Excel Applying Simple Arithmetic Formula

  • The result is properly converted into the number of hours.

Convert Time to Number in Excel Applying Simple Arithmetic Formula

  • Use the Fill Handle tool to get the full results.

Convert Time to Number in Excel Applying Simple Arithmetic Formula

  • Select cell D6 and paste down the formula below.
=B6*1440

Here, we multiplied the cell reference of B6 with 1,440 as it’s the number of minutes in a whole day.

  • Press Enter.

Convert Time to Number in Excel Applying Simple Arithmetic Formula

  • Select cell F6.
  • Copy the formula below and press Enter.
=B6*86400

We multiplied the value of cell B6 by 86,400 because it’s the number of seconds in a day.

Convert Time to Number in Excel Applying Simple Arithmetic Formula

  • We converted the Time into the Number of Hours, Minutes, and Seconds.

Convert Time to Number in Excel Applying Simple Arithmetic Formula

Read More: How to Convert Time to Seconds in Excel


Method 4 – Combining Excel HOUR, MINUTE, and SECOND Functions to Convert Time to Number

Convert Time to Number in Excel Using Multiple Functions

Steps

  • Select cell C6 and put down the formula below.
=HOUR(B6)+MINUTE(B6)/60+SECOND(B6)/3600

Here, B6 serves as the cell reference for the first Time in the list.

⚙️ Formula Breakdown

  • HOUR(B6) The HOUR function returns the hour of a time value. Here, B6 is the serial_number argument. It is the time containing the hour we want to find.
    • Output 8
  • MINUTE(B6)/60 The MINUTE function returns the minutes of a time value. Then, we divided the output by 60 to get the result in hours.
    • Output 0.75
  • SECOND(B6)/3600 The Second function returns the seconds of a time value. The second is given as an integer in the range 0 to 59. We divided the output by 3600 to get it in hours.
    • Output 0
  • Press the Enter key.

Convert Time to Number in Excel Using Multiple Functions

  • Select cell D6 and put down the formula below:
=HOUR(B6)*60+MINUTE(B6)+SECOND(B6)/60

We’re calculating the number in minutes. So, we have to multiply the output of the HOUR function by 60. This converts the value from hours to minutes.

Convert Time to Number in Excel Using Multiple Functions

  • Select cell E6 and paste the formula below:
=HOUR(B6)*3600+MINUTE(B6)*60+SECOND(B6)
  • Press Enter.

Implementing HOUR, MINUTE, and SECOND Functions

  • We have converted the Time into Numbers of Hours, Minutes, and Seconds.

Implementing HOUR, MINUTE, and SECOND Functions


Method 5 – Use of CONVERT Function to Convert Time to Number in Excel

Employing an Excel Function

Steps

  • Select cell C6 and write down the formula below:
=CONVERT(B6,"day","hr")

Here, B6 represents the time 8:45:12 AM.

In this function, the last two arguments are from_unit and to_unit. From_unit is the unit of the input. Whereas, to_unit is the unit for the result. In this case, the day is the from_unit and hr is the to_unit. This function converts the time of the day to just hours.

Employing an Excel Function

  • Repeat the function in the other two columns, changing the to_unit argument to mn and sec, respectively.

Employing an Excel Function


Conversion of Time Difference to Numbers in Excel

Consider a dataset containing the Start Time in Column C and End Time in Column D of a certain work.

Conversion of Difference in Numbers

  • Select cell E5 and paste down the formula below:
=D5-C5

Here, C5 and D5 serve as cell references for the first Start and End Time. These are 7:40 AM and 12:25 PM.

  • Press the Enter key.

Conversion of Difference in Numbers

  • Copy cells in the E5:E10 range.
  • Go to the Home tab.
  • Select Paste in the ribbon as per the image below.
  • Select cell F5.
  • Paste the copied data as Values (V).

Conversion of Difference in Numbers

  • Change the cell format as in Method 3.

Conversion of Difference in Numbers

  • The time difference is shown as numbers on the sheet.

Conversion of Difference in Numbers


Download Practice Workbook

You may download the following Excel workbook for better understanding and practice yourself.


Related Articles


<< Go Back to Time Conversion | Date-Time in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shahriar Abrar Rafid
Shahriar Abrar Rafid

Shahriar Abrar Rafid, BSc, Naval Architecture and Marine Engineering, Bangladesh University of Engineering and Technology, Bangladesh, has worked with the ExcelDemy project for more than 1 year. He has written over 100+ articles for ExcelDemy. He is a professional visual content developer adept at crafting scripts, meticulously editing Excel files, and delivering insightful video tutorials for YouTube channels. His work and learning interests vary from Microsoft Office Suites and Excel to Data Analysis, VBA, and Video recording and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo