From date to date excel formula

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

Occasionally, dates may become formatted and stored in cells as text. For example, you may have entered a date in a cell that was formatted as text, or the data might have been imported or pasted from an external data source as text.

Dates that are formatted as text are left-aligned in a cell (instead of right-aligned). When Error Checking is enabled, text dates with two-digit years might also be marked with an error indicator: Cell with a formula error .

Because Error Checking in Excel can identify text-formatted dates with two-digit years, you can use the automatic correction options to convert them to date-formatted dates. You can use the DATEVALUE function to convert most other types of text dates to dates.

If you import data into Excel from another source, or if you enter dates with two-digit years into cells that were previously formatted as text, you may see a small green triangle in the upper-left corner of the cell. This error indicator tells you that the date is stored as text, as shown in this example.

Cells with green error indicator in upper-left corner

You can use the Error Indicator to convert dates from text to date format.

Notes: First, ensure that Error Checking is enabled in Excel. To do that:

  1. Click File > Options > Formulas.

    In Excel 2007, click the Microsoft Office button Office button image , then click Excel Options > Formulas.

  2. In Error Checking, check Enable background error checking. Any error that is found, will be marked with a triangle in the top-left corner of the cell.

  3. Under Error checking rules, select Cells containing years represented as 2 digits.

Follow this procedure to convert the text-formatted date to a normal date:

  1. On the worksheet, select any single cell or range of adjacent cells that has an error indicator in the upper-left corner. For more information, see Select cells, ranges, rows, or columns on a worksheet.

    Tip: To cancel a selection of cells, click any cell on the worksheet.

  2. Click the error button that appears near the selected cell(s).

    Error button

     

  3. On the menu, click either Convert XX to 20XX or Convert XX to 19XX. If you want to dismiss the error indicator without converting the number, click Ignore Error.

    Commands for converting dates

     

    The text dates with two-digit years convert to standard dates with four-digit years.

    Converted dates

     

    Once you have converted the cells from text-formatted dates, you can change the way the dates appear in the cells by applying date formatting.

If your worksheet has dates that were perhaps imported or pasted that end up looking like a series of numbers like in the picture below, you probably would want to reformat them so they appear as either short or long dates. The date format will also be more useful if you want to filter, sort, or use it in date calculations.

column of dates in text format

  1. Select the cell, cell range, or column that you want to reformat.

  2. Click Number Format and pick the date format you want.

The Short Date format looks like this:

change data to short date format from ribbon

The Long Date includes more information like in this picture:

button on the ribbon to change to long date format

To convert a text date in a cell to a serial number, use the DATEVALUE function. Then copy the formula, select the cells that contain the text dates, and use Paste Special to apply a date format to them.

Follow these steps:

  1. Select a blank cell and verify that its number format is General.

  2. In the blank cell:

    1. Enter =DATEVALUE(

    2. Click the cell that contains the text-formatted date that you want to convert.

    3. Enter )

    4. Press ENTER, and the DATEVALUE function returns the serial number of the date that is represented by the text date.
       

      What is an Excel serial number?

      Excel stores dates as sequential serial numbers so that they can be used in calculations. By default, January 1, 1900, is serial number 1, and January 1, 2008, is serial number 39448 because it is 39,448 days after January 1, 1900.To copy the conversion formula into a range of contiguous cells, select the cell containing the formula that you entered, and then drag the fill handle Fill handle across a range of empty cells that matches in size the range of cells that contain text dates.

  3. After you drag the fill handle, you should have a range of cells with serial numbers that corresponds to the range of cells that contain text dates.

  4. Select the cell or range of cells that contains the serial numbers, and then on the Home tab, in the Clipboard group, click Copy.

    Keyboard shortcut:  You can also press CTRL+C.

  5. Select the cell or range of cells that contains the text dates, and then on the Home tab, in the Clipboard group, click the arrow below Paste, and then click Paste Special.

  6. In the Paste Special dialog box, under Paste, select Values, and then click OK.

  7. On the Home tab, click the popup window launcher next to Number.

  8. In the Category box, click Date, and then click the date format that you want in the Type list.

  9. To delete the serial numbers after all of the dates are converted successfully, select the cells that contain them, and then press DELETE.

Need more help?

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

Need more help?

Date column has date and time in different formats.

05-09-14 21:58
11-08-13 11:56
08/19/2016 11:08:46
11-08-13 11:56
11-08-13 12:16
05/24/2014 08:26:06
08/24/2016 11:00:29
12/20/2014 09:16:19
08/25/2016 09:38:22
08/24/2016 10:59:05
08/25/2016 12:36:33
08/19/2016 10:38:37
11-08-13 14:53
11-08-13 16:18
11-08-13 13:38
10-10-13 16:14
11-08-13 12:44
08/31/2016 17:13:57

I’m trying to convert these datetime into only date m/d/YYYY format.
I tried =TEXT(cellofdate, «m/d/YYYY») but i’m still getting time for some entries.

Scott Craner's user avatar

Scott Craner

146k9 gold badges47 silver badges80 bronze badges

asked Sep 9, 2016 at 9:51

Sai Avinash's user avatar

2

A date is just a number.
To the left of the decimal place is the date, to the right is the time.

=INT(A1) will return the whole number.
Your first example will display as 05/09/2014 00:00. All you need to do now is format the cell as a date without the time.

Edit: And read the post that @Ralph linked to — very informative.

answered Sep 9, 2016 at 13:23

Darren Bartrup-Cook's user avatar

If your concerned cell is A1, you can use the following expression :

  =DATEVALUE(MONTH(A1) & "/" & DAY(A1) & "/" & YEAR(A1))

answered Sep 9, 2016 at 9:54

Landelin Delcoucq's user avatar

Excel handles dates and time using a scheme in which dates are serial numbers and times are fractional values. For example, June 1, 2000 12:00 PM is represented in Excel as the number 36678.5, where 36678 is the date portion and .5 is the time portion.

If you have dates that include time, you can use the INT function to extract just the date part. The INT function returns the integer portion of a number that includes a decimal value. 

So, assuming A1 contains the date and time, June 1, 2000 12:00 PM (equivalent to the number 36678.5), the formula below returns just the date portion (36678):

=INT(A1)

The time portion of the value (the fractional part) is discarded. To see the result formatted as a date, be sure to apply a date number format. Make sure you use a date format that does not include a time. Otherwise, you’ll see the time displayed as 12:00 AM.

Explanation 

When date information from other systems is pasted or imported to Excel, it may not be recognized as a proper date or time. Instead, Excel may interpret this information as a text or string value only. In this example, the goal is to extract valid date and time information from a text string and convert that information into a datetime. It is important to understand that Excel dates and Excel times are numbers so at a high level, the main task is to convert a text value to the appropriate numeric value.

Date

To get the date, we extract the first 10 characters of the value with the LEFT function:

LEFT(B5,10) // returns "2015-03-01"

The result is text, so to get Excel to interpret as a date, we wrap LEFT in DATEVALUE, which converts the text into a proper Excel date.

Time

To get the time, we extract 8 characters from the middle of the text with the MID function:

MID(B5,12,8) // returns "12:28:45"

Again, the result is text. To get Excel to interpret this value as time, we wrap MID in TIMEVALUE, which converts the text into a proper Excel time.

Datetime

To get a final datetime, we just add the date value to the time value. The formula in E5 is:

=C5+D5

Once you have a valid datetime, use custom number formatting to display the value as desired.

All in one formula

Although this example extracts the date and time separately for clarity, you can combine formulas if you like. The following formula extracts the date and time, and adds them together in one step:

=LEFT(date,10)+MID(date,12,8)

Note that DATEVALUE and TIMEVALUE aren’t necessary in this case because the math operation (+) causes Excel to automatically coerce the text values to numbers.

Как преобразовать ячейку формата даты / времени в дату только в Excel?

Если вы хотите преобразовать ячейку формата даты и времени только в значение даты, такое как 2016/4/7 1:01 AM до 2016/4/7, эта статья может вам помочь.

Преобразование ячейки формата даты / времени в дату только с помощью формулы
Легко удаляйте все времена из дат всего несколькими щелчками мыши
Преобразование ячейки формата даты/времени в дату только с помощью Kutools for Excel


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

Следующая формула поможет вам преобразовать ячейку формата даты / времени в дату только в Excel.

1. Выберите пустую ячейку, в которую вы поместите значение даты, затем введите формулу. = МЕСЯЦ (A2) & «/» & ДЕНЬ (A2) & «/» & ГОД (A2) в строку формул и нажмите Enter .

2. Вы можете видеть, что только значение даты заполняется в выбранной ячейке на основе ячейки даты / времени. Продолжайте выбирать ячейку даты, затем перетащите маркер заполнения вниз, чтобы отобразить все даты, основанные на других ячейках даты / времени. Смотрите скриншот:


Легко удаляйте все времена из дат всего несколькими щелчками мыши

В этом разделе показано, как легко удалить все время из выбранных ячеек даты с помощью утилиты «Удалить время из даты» Kutools for Excel. Пожалуйста, сделайте следующее.

1. Выберите пустую ячейку для определения даты после удаления времени из (говорит C2). Нажмите Кутулс > Формула Помощник > Формула Помощник. Смотрите скриншот:

2. в Помощник по формулам диалоговое окно, настройте следующим образом.

  • В разделе Выберите формулу коробка, найдите и выберите Удалить время из даты;
    Tips: Вы можете проверить Фильтр введите определенное слово в текстовое поле, чтобы быстро отфильтровать формулу.
  • Выберите ячейку с датой и временем, вам нужно сохранить только дату в DateTime коробка;
  • Нажмите OK кнопку.

3. Продолжайте выбирать первую ячейку результата, затем перетащите маркер заполнения вниз, чтобы получить все результаты, как вам нужно, как показано ниже:

Теперь все времена удалены из указанных дат.

  Если вы хотите получить бесплатную пробную версию (30-день) этой утилиты, пожалуйста, нажмите, чтобы загрузить это, а затем перейдите к применению операции в соответствии с указанными выше шагами.


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

Вот рекомендую удобный инструмент — Kutools for Excel, С этими Применить форматирование даты Утилита, вы можете легко преобразовать ячейку формата даты / времени в любой формат даты, который вам нужен.

1. Выберите ячейку формата даты / времени, в которой будет отображаться только значение даты, затем щелкните Кутулс > Формат > Применить форматирование даты. Смотрите скриншот:

2. в Применить форматирование даты диалоговом окне выберите формат даты в Форматирование даты поле, а затем щелкните OK кнопку.

Теперь ячейки формата даты / времени отображаются только как значение даты. Смотрите скриншот:

Внимание: Хотя ячейки формата даты / времени отображаются только как дата, отображаемые значения в строке формул по-прежнему имеют формат даты / времени. Если вы хотите преобразовать значения, отображаемые в строке формул, в их фактические значения, выберите их и щелкните Кутулс > К фактическому. Смотрите скриншот:

  Если вы хотите получить бесплатную пробную версию (30-день) этой утилиты, пожалуйста, нажмите, чтобы загрузить это, а затем перейдите к применению операции в соответствии с указанными выше шагами.


Преобразование ячейки формата даты / времени только в дату


Статьи по теме:

  • Как изменить американский формат даты в Excel?

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

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

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

вкладка kte 201905


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

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

офисный дно

Понравилась статья? Поделить с друзьями:
  • From csv to excel mac os
  • French word used in english sentences
  • From csv to excel java
  • From csv to excel format
  • French word that we use in english