Time and date functions in excel

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More…Less

To get detailed information about a function, click its name in the first column.

Note: Version markers indicate the version of Excel a function was introduced. These functions aren’t available in earlier versions. For example, a version marker of 2013 indicates that this function is available in Excel 2013 and all later versions.

Function

Description

DATE function

Returns the serial number of a particular date

DATEDIF function

Calculates the number of days, months, or years between two dates. This function is useful in formulas where you need to calculate an age.

DATEVALUE function

Converts a date in the form of text to a serial number

DAY function

Converts a serial number to a day of the month

DAYS function

Excel 2013

Returns the number of days between two dates

DAYS360 function

Calculates the number of days between two dates based on a 360-day year

EDATE function

Returns the serial number of the date that is the indicated number of months before or after the start date

EOMONTH function

Returns the serial number of the last day of the month before or after a specified number of months

HOUR function

Converts a serial number to an hour

ISOWEEKNUM function

Excel 2013

Returns the number of the ISO week number of the year for a given date

MINUTE function

Converts a serial number to a minute

MONTH function

Converts a serial number to a month

NETWORKDAYS function

Returns the number of whole workdays between two dates

NETWORKDAYS.INTL function

Excel 2010

Returns the number of whole workdays between two dates using parameters to indicate which and how many days are weekend days

NOW function

Returns the serial number of the current date and time

SECOND function

Converts a serial number to a second

TIME function

Returns the serial number of a particular time

TIMEVALUE function

Converts a time in the form of text to a serial number

TODAY function

Returns the serial number of today’s date

WEEKDAY function

Converts a serial number to a day of the week

WEEKNUM function

Converts a serial number to a number representing where the week falls numerically with a year

WORKDAY function

Returns the serial number of the date before or after a specified number of workdays

WORKDAY.INTL function

Excel 2010

Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days

YEAR function

Converts a serial number to a year

YEARFRAC function

Returns the year fraction representing the number of whole days between start_date and end_date

Important: The calculated results of formulas and some Excel worksheet functions may differ slightly between a Windows PC using x86 or x86-64 architecture and a Windows RT PC using ARM architecture. Learn more about the differences.

Need more help?

Содержание

  • Работа с функциями даты и времени
    • ДАТА
    • РАЗНДАТ
    • ТДАТА
    • СЕГОДНЯ
    • ВРЕМЯ
    • ДАТАЗНАЧ
    • ДЕНЬНЕД
    • НОМНЕДЕЛИ
    • ДОЛЯГОДА
  • Вопросы и ответы

Функции даты и времени в Microsoft Excel

Одной из самых востребованных групп операторов при работе с таблицами Excel являются функции даты и времени. Именно с их помощью можно проводить различные манипуляции с временными данными. Дата и время зачастую проставляется при оформлении различных журналов событий в Экселе. Проводить обработку таких данных – это главная задача вышеуказанных операторов. Давайте разберемся, где можно найти эту группу функций в интерфейсе программы, и как работать с самыми востребованными формулами данного блока.

Работа с функциями даты и времени

Группа функций даты и времени отвечает за обработку данных, представленных в формате даты или времени. В настоящее время в Excel насчитывается более 20 операторов, которые входят в данный блок формул. С выходом новых версий Excel их численность постоянно увеличивается.

Любую функцию можно ввести вручную, если знать её синтаксис, но для большинства пользователей, особенно неопытных или с уровнем знаний не выше среднего, намного проще вводить команды через графическую оболочку, представленную Мастером функций с последующим перемещением в окно аргументов.

  1. Для введения формулы через Мастер функций выделите ячейку, где будет выводиться результат, а затем сделайте щелчок по кнопке «Вставить функцию». Расположена она слева от строки формул.
  2. Перемещение в Мастер функций в Microsoft Excel

  3. После этого происходит активация Мастера функций. Делаем клик по полю «Категория».
  4. Мастер функций в Microsoft Excel

  5. Из открывшегося списка выбираем пункт «Дата и время».
  6. Выбор категории функций в Microsoft Excel

  7. После этого открывается перечень операторов данной группы. Чтобы перейти к конкретному из них, выделяем нужную функцию в списке и жмем на кнопку «OK». После выполнения перечисленных действий будет запущено окно аргументов.

Переход к аргументам функции в Microsoft Excel

Кроме того, Мастер функций можно активировать, выделив ячейку на листе и нажав комбинацию клавиш Shift+F3. Существует ещё возможность перехода во вкладку «Формулы», где на ленте в группе настроек инструментов «Библиотека функций» следует щелкнуть по кнопке «Вставить функцию».

Переход к вставке функции в Microsoft Excel

Имеется возможность перемещения к окну аргументов конкретной формулы из группы «Дата и время» без активации главного окна Мастера функций. Для этого выполняем перемещение во вкладку «Формулы». Щёлкаем по кнопке «Дата и время». Она размещена на ленте в группе инструментов «Библиотека функций». Активируется список доступных операторов в данной категории. Выбираем тот, который нужен для выполнения поставленной задачи. После этого происходит перемещение в окно аргументов.

Переход к формулам в Microsoft Excel

Урок: Мастер функций в Excel

ДАТА

Одной из самых простых, но вместе с тем востребованных функций данной группы является оператор ДАТА. Он выводит заданную дату в числовом виде в ячейку, где размещается сама формула.

Его аргументами являются «Год», «Месяц» и «День». Особенностью обработки данных является то, что функция работает только с временным отрезком не ранее 1900 года. Поэтому, если в качестве аргумента в поле «Год» задать, например, 1898 год, то оператор выведет в ячейку некорректное значение. Естественно, что в качестве аргументов «Месяц» и «День» выступают числа соответственно от 1 до 12 и от 1 до 31. В качестве аргументов могут выступать и ссылки на ячейки, где содержатся соответствующие данные.

Lumpics.ru

Для ручного ввода формулы используется следующий синтаксис:

=ДАТА(Год;Месяц;День)

Функция ДАТА в Microsoft Excel

Близки к этой функции по значению операторы ГОД, МЕСЯЦ и ДЕНЬ. Они выводят в ячейку значение соответствующее своему названию и имеют единственный одноименный аргумент.

РАЗНДАТ

Своего рода уникальной функцией является оператор РАЗНДАТ. Он вычисляет разность между двумя датами. Его особенность состоит в том, что этого оператора нет в перечне формул Мастера функций, а значит, его значения всегда приходится вводить не через графический интерфейс, а вручную, придерживаясь следующего синтаксиса:

=РАЗНДАТ(нач_дата;кон_дата;единица)

Из контекста понятно, что в качестве аргументов «Начальная дата» и «Конечная дата» выступают даты, разницу между которыми нужно вычислить. А вот в качестве аргумента «Единица» выступает конкретная единица измерения этой разности:

  • Год (y);
  • Месяц (m);
  • День (d);
  • Разница в месяцах (YM);
  • Разница в днях без учета годов (YD);
  • Разница в днях без учета месяцев и годов (MD).

Функция РАЗНДАТ в Microsoft Excel

Урок: Количество дней между датами в Excel

ЧИСТРАБДНИ

В отличии от предыдущего оператора, формула ЧИСТРАБДНИ представлена в списке Мастера функций. Её задачей является подсчет количества рабочих дней между двумя датами, которые заданы как аргументы. Кроме того, имеется ещё один аргумент – «Праздники». Этот аргумент является необязательным. Он указывает количество праздничных дней за исследуемый период. Эти дни также вычитаются из общего расчета. Формула рассчитывает количество всех дней между двумя датами, кроме субботы, воскресенья и тех дней, которые указаны пользователем как праздничные. В качестве аргументов могут выступать, как непосредственно даты, так и ссылки на ячейки, в которых они содержатся.

Синтаксис выглядит таким образом:

=ЧИСТРАБДНИ(нач_дата;кон_дата;[праздники])

Аргументы функции ЧИСТОРАБДНИ в Microsoft Excel

ТДАТА

Оператор ТДАТА интересен тем, что не имеет аргументов. Он в ячейку выводит текущую дату и время, установленные на компьютере. Нужно отметить, что это значение не будет обновляться автоматически. Оно останется фиксированным на момент создания функции до момента её перерасчета. Для перерасчета достаточно выделить ячейку, содержащую функцию, установить курсор в строке формул и кликнуть по кнопке Enter на клавиатуре. Кроме того, периодический пересчет документа можно включить в его настройках. Синтаксис ТДАТА такой:

=ТДАТА()

Функция ТДАТА в Microsoft Excel

СЕГОДНЯ

Очень похож на предыдущую функцию по своим возможностям оператор СЕГОДНЯ. Он также не имеет аргументов. Но в ячейку выводит не снимок даты и времени, а только одну текущую дату. Синтаксис тоже очень простой:

=СЕГОДНЯ()

Функция СЕГОДНЯ в Microsoft Excel

Эта функция, так же, как и предыдущая, для актуализации требует пересчета. Перерасчет выполняется точно таким же образом.

ВРЕМЯ

Основной задачей функции ВРЕМЯ является вывод в заданную ячейку указанного посредством аргументов времени. Аргументами этой функции являются часы, минуты и секунды. Они могут быть заданы, как в виде числовых значений, так и в виде ссылок, указывающих на ячейки, в которых хранятся эти значения. Эта функция очень похожа на оператор ДАТА, только в отличии от него выводит заданные показатели времени. Величина аргумента «Часы» может задаваться в диапазоне от 0 до 23, а аргументов минуты и секунды – от 0 до 59. Синтаксис такой:

=ВРЕМЯ(Часы;Минуты;Секунды)

Функция ВРЕМЯ в Microsoft Excel

Кроме того, близкими к этому оператору можно назвать отдельные функции ЧАС, МИНУТЫ и СЕКУНДЫ. Они выводят на экран величину соответствующего названию показателя времени, который задается единственным одноименным аргументом.

ДАТАЗНАЧ

Функция ДАТАЗНАЧ очень специфическая. Она предназначена не для людей, а для программы. Её задачей является преобразование записи даты в обычном виде в единое числовое выражение, доступное для вычислений в Excel. Единственным аргументом данной функции выступает дата как текст. Причем, как и в случае с аргументом ДАТА, корректно обрабатываются только значения после 1900 года. Синтаксис имеет такой вид:

=ДАТАЗНАЧ (дата_как_текст)

Функция ДАТАЗНАЧ в Microsoft Excel

ДЕНЬНЕД

Задача оператора ДЕНЬНЕД – выводить в указанную ячейку значение дня недели для заданной даты. Но формула выводит не текстовое название дня, а его порядковый номер. Причем точка отсчета первого дня недели задается в поле «Тип». Так, если задать в этом поле значение «1», то первым днем недели будет считаться воскресенье, если «2» — понедельник и т.д. Но это не обязательный аргумент, в случае, если поле не заполнено, то считается, что отсчет идет от воскресенья. Вторым аргументом является собственно дата в числовом формате, порядковый номер дня которой нужно установить. Синтаксис выглядит так:

=ДЕНЬНЕД(Дата_в_числовом_формате;[Тип])

Функция ДЕНЬНЕД в Microsoft Excel

НОМНЕДЕЛИ

Предназначением оператора НОМНЕДЕЛИ является указание в заданной ячейке номера недели по вводной дате. Аргументами является собственно дата и тип возвращаемого значения. Если с первым аргументом все понятно, то второй требует дополнительного пояснения. Дело в том, что во многих странах Европы по стандартам ISO 8601 первой неделей года считается та неделя, на которую приходится первый четверг. Если вы хотите применить данную систему отсчета, то в поле типа нужно поставить цифру «2». Если же вам более по душе привычная система отсчета, где первой неделей года считается та, на которую приходится 1 января, то нужно поставить цифру «1» либо оставить поле незаполненным. Синтаксис у функции такой:

=НОМНЕДЕЛИ(дата;[тип])

Функция НОМНЕДЕЛИ в Microsoft Excel

ДОЛЯГОДА

Оператор ДОЛЯГОДА производит долевой расчет отрезка года, заключенного между двумя датами ко всему году. Аргументами данной функции являются эти две даты, являющиеся границами периода. Кроме того, у данной функции имеется необязательный аргумент «Базис». В нем указывается способ вычисления дня. По умолчанию, если никакое значение не задано, берется американский способ расчета. В большинстве случаев он как раз и подходит, так что чаще всего этот аргумент заполнять вообще не нужно. Синтаксис принимает такой вид:

=ДОЛЯГОДА(нач_дата;кон_дата;[базис])

Функция ДОЛЯГОДА в Microsoft Excel

Мы прошлись только по основным операторам, составляющим группу функций «Дата и время» в Экселе. Кроме того, существует ещё более десятка других операторов этой же группы. Как видим, даже описанные нами функции способны в значительной мере облегчить пользователям работу со значениями таких форматов, как дата и время. Данные элементы позволяют автоматизировать некоторые расчеты. Например, по введению текущей даты или времени в указанную ячейку. Без овладения управлением данными функциями нельзя говорить о хорошем знании программы Excel.

Year, Month, Day | Date Function | Current Date & Time | Hour, Minute, Second | Time Function

To enter a date in Excel, use the «/» or «-» characters. To enter a time, use the «:» (colon). You can also enter a date and a time in one cell.

Date and Time in Excel

Note: Dates are in US Format. Months first, Days second. This type of format depends on your windows regional settings. Learn more about Date and Time formats.

Year, Month, Day

To get the year of a date, use the YEAR function.

Year Function

Note: use the MONTH and DAY function to get the month and day of a date.

Date Function

1. To add a number of days to a date, use the following simple formula.

Add Days

2. To add a number of years, months and/or days, use the DATE function.

Add Years, Months and Days

Note: the DATE function accepts three arguments: year, month and day. Excel knows that 6 + 2 = 8 = August has 31 days and rolls over to the next month (23 August + 9 days = 1 September).

Current Date & Time

To get the current date and time, use the NOW function.

Now Function

Note: use the TODAY function to enter today’s date in Excel.

Hour, Minute, Second

To return the hour, use the HOUR function.

Hour Function

Note: use the MINUTE and SECOND function to return the minute and second.

Time Function

To add a number of hours, minutes and/or seconds, use the TIME function.

Add Hours, Minutes and Seconds

Note: Excel adds 2 hours, 10 + 1 = 11 minutes and 70 — 60 = 10 seconds.

For work with dates in Excel, in the category «Date and time» is defined in the functions section. Let`s consider the most prevalent functions in this category.



How Excel Processes Time

The Excel program «perceives» the date and time as an ordinary number. The spreadsheet converts to such number, equating the day to unity. As a result, the time value represents a fraction of unity. For example, 12. 00 — is 0. 5.

The date value to the spreadsheet converts to a number which equal to the number of days from January 1, 1900 (so the developers decided) to the specified date. For example, when converting the date 13. 04. 1987, the number is 31880. That is, from 1. 01. 1900 passed 31. 880 days.

This principle underlies in the basis of the calculations of the time data. To find the number of days between two dates, it`s enough to take an earlier period from a later time one.



The example of DATE function

You need to describe of the date value with compiling it with individual elements of numbers.

There is the syntax: year; month, day.

All arguments are required. They can be specified by numbers or by reference to cells with the corresponding numeric data: for the year — from 1900 to 9999; for the month — from 1 to 12; for the day — from 1 to 31.

If you point a larger number for the «Day» argument (than the number of days in the pointed month), you receive the extra days, will be passed to the next month. For example, specifying 32 days for December, we will receive as a result on January 1.

The example of using the function:

example.

Let’s set more days for June:

days June.

Examples of using the cell references as arguments:

cell references as arguments.

The DATEDIF function in Excel

It returns the difference between two dates.

The arguments:

  • start date;
  • final date;
  • the code indicating to the units of counting (days, months, years, etc.).

The methods of measuring intervals between the given dates:

  • to display the result in days — «d»;
  • in months – «m»;
  • in years – «y»;
  • in months without years – «ym»;
  • in days without months and years – «md»;
  • in days without years – «yd».

In some versions of Excel, if you use the last two arguments («md», «yd»), the function may give an error. It is better to use to alternative formulas.

The examples of the operation the DATEDIF function:

DATEDIF.

In Excel 2007 version, this function is not in the directory, but it works. But you need to check the results are better, because there are flaws possible.

The YEAR function in Excel

It returns the year as an integer number (from 1900 to 9999), what corresponds to the specified date. There is only one argument must be entered in the structure of the function – is the date in a numerical format. The argument must be entered using the DATE function or represents to the result of evaluating other formulas.

The example of using the YEAR function:

YEAR.

The MONTH function in Excel: the example

It returns the month as an integer number (from 1 to 12) for a date is specified in a numeric format. The argument – is the date of the month that you want to show in a numerical format. The dates in the text format this function does not handle correctly.

The examples of using the MONTH function:

MONTH.

The examples of DAY, WEEKDAY and functions WEEKNUM in Excel

It returns the day as an integer number (from 1 to 31) for a date specified in a numeric format. The argument – it is the date of the day you want to find in a numerical format.

DAY.

For returning of the weekday ordinal of the specified date, you can apply the function WEEKDAY:

WEEKDAY.

By default, the function considers Sunday the 1-st day of the week.

To display of the ordinal number of the week for the pointed date, you should use the WEEKNUM function:

WEEKNUM.

The date of 24. 05. 2015 is 22 week in a year. The week starts on Sunday (by default).

week starts.

As the second argument the figure 2 is specified. Therefore, the formula considers that the week starts on Monday (the 2-d day of the week).

Download all examples functions for working with dates

For indicating of the current date, the function TODAY (no arguments) is used. To display the current time and date, the function NOW() is used.

Date and Time functions in Excel help you to simplify handling time operations easily. In this article, we’ll learn some of the date and time functions in Excel.

Let’s get started with some of the time functions in Excel. If you’re looking for date functions, you can check out the top 8 date functions that we covered recently.

1. HOUR function

The hour of a time value is returned by the HOUR function. The hour is represented as an integer, with values ranging from 0 to 23.

Syntax: HOUR(time), where time includes the hour you’re looking for. The following example shows the use of HOUR function:

  • Select the cell where you want to display the result.
  • Type =HOUR(A2), where cell A2 contains the time.
hour formula
  • Press the Enter key to display the result.
hour result

2. ISOWEEKNUM function

For a given date, the ISOWEEKNUM function returns the ISO week number of the year.

Syntax: ISOWEEKNUM(date), where date is the date-time code that Excel uses to calculate dates and times. The following example shows the use of ISOWEEKNUM function:

  • Select the cell where you want to display the result.
  • Type =ISOWEEKNUM(A2), where cell A2 contains the date.
isoweeknum formula
  • Press the Enter key to display the result.
isoweeknum result

Note: This function is available in Excel 2013 and above.

3. MINUTE function

The minutes of a time value is returned by the MINUTE function. The minute is expressed as an integer between 0 and 59.

Syntax: MINUTE(time), where time includes the hour you’re looking for. The following example shows the use of MINUTE function:

  • Select the cell where you want to display the result.
  • Type =MINUTE(A2), where cell A2 contains the time.
minute formula
  • Press the Enter key to display the result.
minute result

4. MONTH function

The month of a date is returned by the MONTH function. The month is specified as an integer number ranging from 1 for January to 12 for December.

Syntax: MONTH(date), where date is the date-time code that Excel uses to calculate dates and times. The following example shows the use of MONTH function:

  • Select the cell where you want to display the result.
  • Type =MONTH(A2), where cell A2 contains the date.
month formula
  • Press the Enter key to display the result.
month result

5. NETWORKDAYS function

The NETWORKDAYS function returns the total number of working days between the start date and the end date. Weekends and holidays are not considered working days. Use NETWORKDAYS to compute employee benefits based on the number of days worked over a certain term.

Syntax: NETWORKDAYS(start_date, end_date, [holidays]), where start_date and end_date are the first and last day of the period and holidays parameter to include dates to be excluded. the following example shows the use of NETWORKDAYS function:

  • Select the cell where you want to display the result.
  • Type =NETWORKDAYS(A2,B2,C2), where cells A2, B2 and C2 contains the start date. end date and holiday respectively.
networkdays formula
  • Press the Enter key to display the result.
networkdays result

6. NETWORKDAYS.INTL

The NETWORKDAYS.INTL returns the number of entire workdays between two dates, with arguments specifying which and how many days are weekends. Weekends and other days designated as holidays are not considered workdays.

Syntax: NETWORKDAYS.INTL(start_date, end_date, [weekend], [holidays]), where start_date and end_date are the first and last day of the period, holidays parameter to include dates to be excluded and weekend indicates the weekend days.

Weekend number values are as follows:

  • 1 or omitted: Saturday & Sunday,
  • 2: Sunday & Monday,
  • 3: Monday & Tuesday,
  • 4: Tuesday & Wednesday,
  • 5: Wednesday & Thursday,
  • 6: Thursday & Friday,
  • 7: Friday & Saturday,
  • 11: Sunday only,
  • 12: Monday only,
  • 13: Tuesday only,
  • 14: Wednesday,
  • 15: Thursday only,
  • 16: Friday only,
  • 17: Saturday only.

The following example shows the use of NETWORKDAYS.INTL function:

  • Select the cell where you want to display the result.
  • Type =NETWORKDAYS(A2,B2,C2,D2), where cells A2, B2 and C2 contains the start date. end date, weekend, and holidays respectively.
networkdaysintl formula
  • Press the Enter key to display the result.
networkdaysintl result

Note: This function is available in Excel 2010 and above.

7. NOW function

The NOW function returns the current system date and time. The value is updated every time the worksheet is opened or recalculated.

Syntax: NOW() and it has no arguments. The following example shows the use of NOW function.

  • Select the cell where you want to display the result.
  • Type =NOW().
now formula
  • Press the Enter key to display the result.
now result

8. SECOND function

The seconds of a time value are returned by the SECOND function. The second is expressed as an integer between 0 and 59.

Syntax: SECOND(time), where time includes the seconds you’re looking for. The following example shows the use of SECOND function:

  • Select the cell where you want to display the result.
  • Type =SECOND(A2), where cell A2 contains the time.
second formula
  • Press the Enter key to display the result.
second result

Note: Dates are stored as consecutive serial numbers in Microsoft Excel so that they can be used in calculations. January 1, 1900, is serial number 1 by default, and January 1, 2008, is serial number 39448 because it is 39,448 days after January 1, 1900.

Conclusion

In this article, we learned some of the date and time functions in Excel.

References

  • HOUR function (microsoft.com)
  • ISOWEEKNUM function (microsoft.com)
  • MINUTE function (microsoft.com)
  • MONTH function (microsoft.com)
  • NETWORKDAYS function (microsoft.com)
  • NETWORKDAYS.INTL function (microsoft.com)
  • NOW function (microsoft.com)
  • SECOND function (microsoft.com)

Понравилась статья? Поделить с друзьями:
  • Time and a word перевод
  • Through the word application
  • Through the meaning of the word
  • Three words eight letters one word three letters
  • Three word verbs sentences