Convert time to time excel

Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 Excel 2013 Excel 2010 Excel 2007 More…Less

Let’s say you want to find out how many hours there are in 5.5 days, or how many days there are in 3.45 years, or how precisely how many months will pass between a beginning date and an ending date.

There are several ways to convert time units.

To convert from one time unit to another, use the CONVERT function.

Example: Convert between time units

Note: For conversions that involve a year, consider that a year is 365.25 days.

To convert from hours : minutes : seconds format, use the INT function.  

Example: Convert hours from standard time format to a decimal number

To convert from decimal to hours : minutes : seconds format, use the divisor operator (/) together with the TEXT function.

Example: Convert hours from decimal number to the standard time

Note: You can also apply the time format without using the TEXT function to specify the format. To view the number as a time: select the cell and, on the Home tab—in the Number group—click the arrow next to the Number Format box. Then click More Number Formats, click Custom in the Category list, and then click a custom format in the Type box. Keep in mind: if you use both a format applied with the TEXT function and number format, the TEXT function takes precedence.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

Need more help?

Sometimes in Excel, you may have observed that the time is represented as a string. So, it is very important for us to know the different ways in which we can convert a time string to time or time and data. Read this tutorial to learn how you can convert time strings to time in Excel. We can complete this task using the formulas supported in Excel. We’ll look at solutions for converting strings to time as well as converting strings to time and time again.

Converting Time String to Time in Excel

Here we will use the TIMEVALUE formula to get any one of the results, then use the auto-fill handle to get all the results. Then use the format function to convert them to time format. Let’s take a look at a simple procedure for converting time strings to time in Excel.

Step 1

Let us consider an Excel sheet where the data in the sheet is similar to the data shown in the below image.

Now, in our case, click on an empty cell, B1, and enter the formula =TIMEVALUE(LEFT(A1,LEN(A1)-2)&»:»&RIGHT(A1,2)) and press enter to get our first result, which looks like the image below. In the formula, A1 is the address of our value on the sheet.

Empty cell > Formula > Enter

Step 2

Now drag down from the first result using the auto-fill handle till we get all the values as shown in the below image.

As we can see, we got all the values but now need to change them into time. To do that, we can use the help of a formal cell.

Step 3

Select the data, then right-click and select format cells. Then, in the pop-up window, select time, and in the type box, select valid format, before clicking OK to finish our process.

Select data > Format cells > Time > Format > OK

Note

If our string includes seconds, then we can use the formula −

 =TEXT(--(LEFT(A1,LEN(A1)-1)),"0:00:00")+((RIGHT(A1,1)="P")/2)

To convert time and data, use the formula −

=DATE(LEFT(A1,4), MID(A1,5,2), MID(A1,7,2), +TIME(MID(A1,10,2), RIGHT(A1,2), 0

Conclusion

In this tutorial, we used a simple example to demonstrate how you can convert time strings to time in Excel.

Explanation 

In this example, the goal is to parse a text string into a proper Excel time.

First, note that the cells in F5:F13 are formatted as Text prior to entry. This allows the times to contain leading zeros like «083000». Alternately, you can enter these time strings with a single quote at the start (‘) to force Excel to respect them as text.

Next, the time string contains 6 characters in the following format:

hhmmss // as text

This means the formula needs to pick up 2 characters each for hour, minute, and second. Working from the inside out, this task is performed with the LEFT, MID, and RIGHT functions:

LEFT(E5,2) // get hh
MID(E5,3,2) // get mm
RIGHT(E5,2) // get ss

Each of the functions returns a result directly to the TIME function. In E9, we have:

041055

So the result inside TIME looks like this:

=TIME("04","10","55")

The TIME function then quietly handles the text-to-number conversion and returns a valid time:

04:10:55

Representing 4 hours, 10 minutes, and 55 seconds.

With a 4-character time string

The formula in C5 is meant to handle only a 4 character time string (hours and minutes), so the structure is a bit simpler. We simply hardcode the value for seconds into the TIME function as zero:

=TIME(LEFT(B5,2),MID(B5,3,2),0)

Как правило, при преобразовании времени в десятичные часы или минуты с помощью формулы = ячейка * 24 или ячейка * 1440 результатом будут десятичные числа. Но иногда вы просто хотите преобразовать время в целые часы или минуты, как показано ниже, как вы можете решить эту проблему в Excel?
док время до целого числа 1

Преобразование времени в целые часы или минуты с помощью формулы

Преобразуйте время в целые часы или минуты с помощью Kutools for Excel

Преобразование времени в целые часы или минуты с помощью формулы

С помощью формулы INT вы можете преобразовать время в целые часы или минуты.

Выделите ячейку, в которую хотите поместить результат, выберите нужную формулу из ниже:

  • Преобразовать в целые часы = ЦЕЛОЕ (A2 * 24)
  • Преобразовать в целые минуты = ЦЕЛОЕ (A2 * 1440)

Затем нажмите Enter ключ для получения результата. При необходимости перетащите маркер заполнения вниз, чтобы заполнить ячейки формулой.
док время до целого числа 2


Преобразуйте время в целые часы или минуты с помощью Kutools for Excel

Если у вас есть Kutools для Excel установлен, вы можете применить его Конвертировать время утилита для преобразования времени в десятичные числа, а затем используйте Круглые утилита для округления чисел в большую или меньшую сторону до целых.

1. Выберите время, которое вы хотите преобразовать, нажмите Кутулс > Содержание > Конвертировать время > Время до часов/Время до минут.
док время до целого числа 3

2. Появится диалоговое окно с напоминанием о количестве преобразованных ячеек, щелкните OK чтобы закрыть это. Затем, не снимая выделения с преобразованных ячеек, щелкните Кутулс > Круглые.

3. в Раунд без формулы диалог, тип 0 в Десятичное число текстовое поле, выберите одну круглую форму Опция .
док время до целого числа 6

4. Нажмите Ok чтобы округлить все выбранное десятичное время до целых чисел.
док время до целого числа 7


Лучшие инструменты для работы в офисе

Kutools for Excel Решит большинство ваших проблем и повысит вашу производительность на 80%

  • Снова использовать: Быстро вставить сложные формулы, диаграммы и все, что вы использовали раньше; Зашифровать ячейки с паролем; Создать список рассылки и отправлять электронные письма …
  • Бар Супер Формулы (легко редактировать несколько строк текста и формул); Макет для чтения (легко читать и редактировать большое количество ячеек); Вставить в отфильтрованный диапазон
  • Объединить ячейки / строки / столбцы без потери данных; Разделить содержимое ячеек; Объединить повторяющиеся строки / столбцы… Предотвращение дублирования ячеек; Сравнить диапазоны
  • Выберите Дубликат или Уникальный Ряды; Выбрать пустые строки (все ячейки пустые); Супер находка и нечеткая находка во многих рабочих тетрадях; Случайный выбор …
  • Точная копия Несколько ячеек без изменения ссылки на формулу; Автоматическое создание ссылок на несколько листов; Вставить пули, Флажки и многое другое …
  • Извлечь текст, Добавить текст, Удалить по позиции, Удалить пробел; Создание и печать промежуточных итогов по страницам; Преобразование содержимого ячеек в комментарии
  • Суперфильтр (сохранять и применять схемы фильтров к другим листам); Расширенная сортировка по месяцам / неделям / дням, периодичности и др .; Специальный фильтр жирным, курсивом …
  • Комбинируйте книги и рабочие листы; Объединить таблицы на основе ключевых столбцов; Разделить данные на несколько листов; Пакетное преобразование xls, xlsx и PDF
  • Более 300 мощных функций. Поддерживает Office/Excel 2007-2021 и 365. Поддерживает все языки. Простое развертывание на вашем предприятии или в организации. Полнофункциональная 30-дневная бесплатная пробная версия. 60-дневная гарантия возврата денег.

вкладка kte 201905


Вкладка Office: интерфейс с вкладками в Office и упрощение работы

  • Включение редактирования и чтения с вкладками в Word, Excel, PowerPoint, Издатель, доступ, Visio и проект.
  • Открывайте и создавайте несколько документов на новых вкладках одного окна, а не в новых окнах.
  • Повышает вашу продуктивность на 50% и сокращает количество щелчков мышью на сотни каждый день!

офисный дно

Комментарии (0)


Оценок пока нет. Оцените первым!

Return to Excel Formulas List

Download Example Workbook

Download the example workbook

This tutorial will demonstrate how to convert seconds to days, hours, and minutes in Excel and Google Sheets.

convert seconds to minutes hours Main Function

Convert Seconds to Minutes and Seconds

First divide the number of seconds by 86400 (the number of seconds in a day).

=$B3/86400

MinutesSeconds

Once you have done this, you will get the time value as a number. To display the time value as a valid time (i.e. in minutes and seconds) format the cell with custom formatting.

  1. Highlight the cells you wish to format eg: D3:D10.
  2. In the Ribbon, select Home > Number and then click on the little arrow on the right-hand side of the number group.

Number Format

  1. This brings up the Format Cells dialog box.

Number Format 2

  1. Click on Custom at the bottom of the list, and then type mm:ss into the custom format text box.

Number Format 3

  1. Click OK.

Convert to Hours, Minutes and Seconds

Use hh:mm:ss format to display in hours, minutes, and seconds.

HoursMinutesSeconds

Convert to Days, Hours, Minutes and Seconds in Excel

To display days as well, you can create custom formatting like below.

DaysHoursMinutesSeconds

Convert Seconds to Minutes and Seconds in Google Sheets

As with Excel, the first step to converting elapsed second to time is to divide the value by 86400.

=$B3/86400
  1. To format the cells for mm:ss, select Format > Number > More Formats > More date and time formats from the Menu.

Google 01

Google 02

  1. Delete the 3 formats shown by clicking on each format and selecting Delete.

Google 03

  1. Scroll down the list and find a format with minutes and seconds.

Google 04

  1. Click on that format to add it to the bar at the top of the custom box.

Google 5

  1. Delete the Hour format from the custom format.Google 06
  2. Click Apply to apply the formatting to your worksheet.Google 07

Convert to Hours, Minutes and Seconds in Google Sheets

You use the same formula in Google Sheets as you do in Excel to convert the seconds to time by dividing the value by 86400.

=$B3/86400

Google 08

You then use custom formatting to display the hours as well as the minutes and seconds.

Google 09

Convert to Days, Hours, Minutes and Seconds in Google Sheets

You use the same formula in Google Sheets as you do in Excel to convert the seconds to time by dividing the value by 86400.

=$B3/86400

You then use custom formatting to display the days as well as the hours, minutes and seconds.

  1. Delete the formatting in the Custom date and time formats box, and then click on the drop-down box to the right of the custom format box to display all the date and time options.

Google 10

  1. Select Day and then type “days’, select Hour and then type “hours”, select Minute and then type “minutes” and then select Second and type “seconds”

Google 11

  1. Click Apply.

Google 12

Понравилась статья? Поделить с друзьями:
  • Convert the pdf to word online free
  • Convert the pdf to excel online
  • Convert the pdf into word file
  • Convert doc to pdf with word
  • Convert doc from pdf to word online