Watch video – Convert Date to Text in Excel
Date and Time in Excel are stored as numbers. This enables a user to use these dates and time in calculations. For example, you can add a specific number of days or hours to a given date.
However, sometimes you may want these dates to behave like text. In such cases, you need to know how to convert the date to text.
Below is an example where dates are combined with text. You can see that the dates don’t retain their format and show up as numbers in the combined text.
In such situations, it’s required to convert a date into text.
Convert Date to Text in Excel
In this tutorial, you’ll learn three ways to convert the date to text in Excel:
- Using the Text Function
- Using the Text to Column feature
- Using the Copy-Paste method
Convert Date to Text using Text Function
TEXT function is best used when you want to display a value in a specific format. In this case, it would be to display the date (which is a number) in the date format.
Let’s first see how the text function works.
Here is the syntax:
=TEXT(value, format_text)
It takes two arguments:
- value – the number that you want to convert into text. This can be a number, a cell reference that contains a number, or a formula result that returns a number.
- format_text – the format in which you want to display the number. The format needs to be specified within double quotes.
Using the Text function requires a basic understanding of the formats that you can use in it.
In the case of dates, there are four parts to the format:
- day format
- month format
- year format
- separator
Here are the formats you can use for each part:
- Day Format:
- d – it shows the day number without a leading zero. So 2 will be shown as 2 and 12 will be shown as 12.
- dd – it shows the day number with a leading zero. So 2 will be shown as 02, and 12 will be shown as 12
- ddd – it shows the day name as a three letter abbreviation of the day. For example, if the day is a Monday, it will show Mon.
- dddd – it shows the full name of the day. For example, if it’s Monday, it will be shown as Monday.
- Month Format:
- m – it shows the month number without a leading zero. So 2 will be shown as 2 and 12 will be shown as 12.
- mm – it shows the month number with a leading zero. So 2 will be shown as 02, and 12 will be shown as 12
- mmm – it shows the month name as a three letter abbreviation of the day. For example, if the month is August, it will show Aug.
- mmmm – it shows the full name of the month. For example, if the month is August, it will show August.
- Year Format:
- yy – it shows the two digit year number. For example, if it is 2016, it will show 16.
- yyyy – it shows the four digit year number. For example, if it is 2016, it will show 2016.
- Separator:
- / (forward slash): A forward slash can be used to separate the day, month, and year part of a date. For example, if you specify “dd/mmm/yyyy” as the format, it would return a date with the following format: 31/12/2016.
- – (dash): A dash can be used to separate the day, month, and year part of a date. For example, if you specify “dd-mmm-yyyy” as the format, it would return a date with the following format: 31-12-2016.
- Space and comma: You can also combine space and comma to create a format such as “dd mmm, yyyy”. This would show the date in the following format: 31 Mar, 2016.
Let’s see a few examples of how to use the TEXT function to convert date to text in Excel.
Example 1: Converting a Specified Date to Text
Let’s again take the example of the date of joining:
Here’s the formula that will give you the right result:
=A2&"'s joining date is "&TEXT(B2,"dd-mm-yyyy")
Note that instead of using the cell reference that has the date, we have used the TEXT function to convert it into text using the specified format.
Below are some variations of different formats that you can use:
You can experiment with other formats as well and create your own combinations.
Also read: How to Convert Text to Date in Excel (8 Easy Ways)
Example 2: Converting Current Date to Text
To convert the current date into text, you can use the TODAY function along with the TEXT function.
Here is a formula that will do it:
="Today is "&TEXT(TODAY(),"dd/mm/yyyy")
This could be useful in dashboards/reports, where as soon as the file is opened (or any changes are made), the date refreshes to show the current date.
Convert Date to Text using Text to Column
If you’re not a fan of Excel formulas, there is another cool way to quickly convert date to text in Excel – the Text to Column feature.
Suppose you have a dataset as shown below and you want to convert these dates into text format:
Here are the steps to do this:
- Select all the cells that contain dates that you want to convert to text.
- Go to Data –> Data Tools –> Text to Column.
- In the Text to Column Wizard, make the following selections:
This would instantly convert the dates into text format.
Note: There is a difference in the format of the dates in the two columns. While the original format had dd mmm, yyyy format, the result is dd-mm-yyyy. Remember that the Text to Column feature will always convert dates to the default short date format (which is dd-mm-yyyy as per my systems regional settings. It could be different for yours).
Also read: How to Convert Serial Numbers to Dates in Excel (2 Easy Ways)
If you want the date in other formats, use the formula method, or the copy-paste method shown below.
Convert Date to Text using the Copy-Paste Method
This is the fastest way to convert date to text.
Here are the steps:
You May Also Like the Following Excel Tutorials:
- Convert Text to Numbers in Excel – A Step By Step Tutorial.
- How to Convert Formulas to Values in Excel.
- How to Quickly Transpose Data in Excel.
- [Quick Tip] How to Split Cells in Excel.
- Excel Timesheet Calculator Template.
- How to Insert Date and Timestamp in Excel.
- Excel Calendar Template.
- How to Remove Time from Date in Excel
- Convert Time to Decimal Number in Excel (Hours, Minutes, Seconds)
- How To Convert Date To Serial Number In Excel?
На чтение 5 мин Просмотров 4.4к. Опубликовано 19.02.2022
Excel сохраняет даты в виде порядковых номеров. Человеку невозможно их читать и понимать, но, таким образом, можно использовать их в функциях расчета, к примеру добавить к дате или времени какое-то количество времени (день, год и так далее).
Но, довольно часто, вам может быть нужно использовать даты в одних ячейках с текстом, так сказать, объединять.
На картинке пример объединения даты с текстом в одной ячейке. Видите как выглядит наша дата? Это формат порядкового номера Excel.
Именно в таких ситуациях вам может понадобиться привести дату в «читаемый» формат.
Содержание
- Переводим дату в текстовый формат
- Как привести указанную дату в текстовый формат
- Как привести текущую дату в текстовый формат
- Переводим дату в текстовый формат с помощью функции «Текст по столбцам»
- Переводим дату в текстовый формат с помощью копирования и вставки
Переводим дату в текстовый формат
Когда нам нужно привести дату в определенный формат (к примеру, 16-08-2016), мы можем вызвать функцию ТЕКСТ.
Итак, как она работает.
Синтаксис:
=ТЕКСТ(значение; формат_текста)
Она принимает два аргумента:
- Значение — в нашем случае это дата, которую вы хотите преобразовать в текст нужного формата. Это может быть просто дата, ссылка на ячейку с датой, или результат формулы.
- Формат_текста — формат, в котором нужно показать нашу дату. Формат должен быть указан в двойных кавычках.
Какие есть форматы и разделители?
Формат дат состоит из 4 составляющих:
- день
- месяц
- год
- разделитель
Ниже приведены форматы, которые можно использовать для каждой части:
Формат дня:
- Д — день будет отображаться без нуля, т.е. 1 будет отображаться как 1, а 12 как 12.
- ДД — день будет отображаться с нулем, т.е. 1 будет 01, а 12 как 12.
- ДДД — будет отображаться день недели(сокращенно), т.е. «Пятница» будет «Пят».
- ДДДД — будет отображаться день недели(полностью), т.е. «Пятница» будет «Пятница».
Формат месяца:
- М — месяц будет отображаться без нуля, т.е. 1 будет отображаться как 1, а 12 как 12.
- ММ — месяц будет отображаться с нулем, т.е. 1 будет 01, а 12 как 12.
- МММ — месяц будет отображаться с сокращенным названием, т.е. «Сентябрь» будет «Сен».
М — месяц будет отображаться без нуля, т.е. 1 будет отображаться как 1, а 12 как 12.
ММ — месяц будет отображаться с нулем, т.е. 1 будет 01, а 12 как 12.
МММ — месяц будет отображаться с сокращенным названием, т.е. «Сентябрь» будет «Сен».
ММММ — месяц будет отображаться с полным названием, т.е. «Сентябрь» будет «Сентябрь».
Формат года:
- ГГ — год будет отображаться как 2 цифры, т.е. 2019 будет 19.
- ГГГГ — год будет отображаться полностью, т.е. 2019 будет 2019.
Разделитель:
- «/» : это просто разделитель между цифрами в дате, т.е. отображаться будет как 01/01/2019.
- «-»: такой же разделитель между цифрами, т.е. отображаться будет как 01-01-2019.
- Пробелы и запятые: тут немного посложней, вы можете комбинировать и создавать свои форматы отображения, например, 01 января, 2019 года.
Итак, разберем примеры.
Как привести указанную дату в текстовый формат
Пример:
Итак, мы получили дату вместе с текстом, но дата сейчас в формате порядкового номера Excel.
Формула:
="Дата"&A2&"="&B2
Теперь, нам нужно получить дату в «привычном» для нас виде.
Формула будет:
="Дата "&A2&" = "&ТЕКСТ(B2;"ДД.ММ.ГГГГ")
Итак, мы вызвали функцию ТЕКСТ, указали ссылку на ячейку и определили формат, результат вы видите на картинке выше.
Какие еще есть форматы и как они выглядят на «выходе»:
Как привести текущую дату в текстовый формат
Для того чтобы получить текущую дату мы можем использовать функцию СЕГОДНЯ.
Формула:
="Сегодня "&ТЕКСТ(СЕГОДНЯ();"ДД/ММ/ГГГГ")
Эта функция может пригодиться вам в случае, если вы формируете отчеты, где важна, например, дата изменения файла.
Переводим дату в текстовый формат с помощью функции «Текст по столбцам»
Если формулы и вызов функций вам не по душе, есть вариант и для вас.
Допустим, у нас есть следующие данные и нам нужно преобразовать их в текстовый формат:
Пошаговая инструкция:
- Выделите ячейки, которые необходимо преобразовать в текст;
- Перейдите в раздел «Данные» -> «Текст по столбцам»;
- В открывшемся окне:
- Выберите опцию «с разделителями»;
- Снимите все галочки и нажмите «Далее»;
- Выберите формат «текстовый» укажите куда поместить наши, уже текстовые, значения и нажмите «Готово».
Функция сразу же переводит даты в текстовый формат.
Важная информация: эта функция устанавливает формат для дат по умолчанию для настроек вашей системы. То есть если вы хотите записать даты в определенном формате вам нужно использовать способы рассмотренные ранее, но для начала дочитайте нашу статью, возможно следующий вариант подойдет вам.
Переводим дату в текстовый формат с помощью копирования и вставки
Пошаговая инструкция:
- Выделите ячейки с датами, которые нужно преобразовать, и скопируйте их;
- Откройте обычный блокнот и вставьте наши данные туда, как только вы это сделаете, данные сразу же потеряют формат, т.е. станут обычным текстом (потому что в блокноте нет никаких форматов данных, кроме текста);
- Выделите ячейки, куда вы будете вставлять даты и поменяйте их формат на «Текстовый»;
- А теперь, заново скопируйте даты из блокнота, а затем вставьте их в Excel.
Excel сохраняет даты в виде порядковых номеров. Человеку невозможно их читать и понимать, но, таким образом, можно использовать их в функциях расчета, к примеру добавить к дате или времени какое-то количество времени (день, год и так далее).
Но, довольно часто, вам может быть нужно использовать даты в одних ячейках с текстом, так сказать, объединять.
На картинке пример объединения даты с текстом в одной ячейке. Видите как выглядит наша дата? Это формат порядкового номера Excel.
Как быстро преобразовать время в текст или количество часов / минут / секунд в Excel?
В этом руководстве я представляю методы преобразования времени в текстовую строку или числовую строку, а также в количество десятичных часов, минут и секунд в Excel.
Преобразовать время в текстовую строку
Преобразовать время в числовую строку
Преобразовать время в количество часов / минут / секунд
Преобразовать время в текстовую строку
Вот формула, которая может преобразовать время в текстовую строку.
Выберите ячейку, в которую будет помещен текстовый результат, введите эту формулу =TEXT(A1,»hh:mm:ss AM/PM»), нажмите Enter ключ. И если вам нужно, перетащите маркер заполнения вниз, чтобы применить эту формулу к ячейкам ниже.
Преобразовать время в числовую строку
Чтобы преобразовать время в числовую строку, вам просто нужно отформатировать ячейки времени как общие.
Выберите ячейки времени, которые вы хотите преобразовать, нажмите Главная вкладку, перейдите к Число группа, выберите Общие из выпадающего списка.
Преобразовать время в количество часов / минут / секунд
Если вы хотите преобразовать время в количество часов / минут / секунд, вы можете выбрать один из следующих методов.
Преобразуйте время в количество часов / минут / секунд с помощью формулы
Продолжительность | Формула | Результат |
16: 15: 48 | = A1 * 24 | 16.26 |
16: 15: 48 | = A1 * 1440 | 975.8 |
16: 15: 48 | = A1 * 86400 | 58548 |
Не забудьте отформатировать ячейки результатов как общие.
Преобразуйте время в количество часов/минут/секунд с помощью Kutools for Excel
После установки Kutools for Excel, пожалуйста, сделайте следующее:(Бесплатная загрузка Kutools for Excel Сейчас!)
Выберите ячейки, которые хотите преобразовать, нажмите Кутулс > Content > Convert Time > Time to Hours/Time to Minutes/Time to Seconds.
Тогда время будет конвертировано.
Функции: Если вы хотите поместить преобразованный результат в другое место, вы можете нажать Кутулс > Content > Convert Time > Convert Time to enable Convert Time диалоговое окно, выберите тип преобразования, отметьте Save to another location Установите флажок и выберите ячейку для размещения результата.
Лучшие инструменты для работы в офисе
Kutools for Excel Решит большинство ваших проблем и повысит вашу производительность на 80%
- Снова использовать: Быстро вставить сложные формулы, диаграммы и все, что вы использовали раньше; Зашифровать ячейки с паролем; Создать список рассылки и отправлять электронные письма …
- Бар Супер Формулы (легко редактировать несколько строк текста и формул); Макет для чтения (легко читать и редактировать большое количество ячеек); Вставить в отфильтрованный диапазон…
- Объединить ячейки / строки / столбцы без потери данных; Разделить содержимое ячеек; Объединить повторяющиеся строки / столбцы… Предотвращение дублирования ячеек; Сравнить диапазоны…
- Выберите Дубликат или Уникальный Ряды; Выбрать пустые строки (все ячейки пустые); Супер находка и нечеткая находка во многих рабочих тетрадях; Случайный выбор …
- Точная копия Несколько ячеек без изменения ссылки на формулу; Автоматическое создание ссылок на несколько листов; Вставить пули, Флажки и многое другое …
- Извлечь текст, Добавить текст, Удалить по позиции, Удалить пробел; Создание и печать промежуточных итогов по страницам; Преобразование содержимого ячеек в комментарии…
- Суперфильтр (сохранять и применять схемы фильтров к другим листам); Расширенная сортировка по месяцам / неделям / дням, периодичности и др .; Специальный фильтр жирным, курсивом …
- Комбинируйте книги и рабочие листы; Объединить таблицы на основе ключевых столбцов; Разделить данные на несколько листов; Пакетное преобразование xls, xlsx и PDF…
- Более 300 мощных функций. Поддерживает Office/Excel 2007-2021 и 365. Поддерживает все языки. Простое развертывание на вашем предприятии или в организации. Полнофункциональная 30-дневная бесплатная пробная версия. 60-дневная гарантия возврата денег.
Вкладка Office: интерфейс с вкладками в Office и упрощение работы
- Включение редактирования и чтения с вкладками в Word, Excel, PowerPoint, Издатель, доступ, Visio и проект.
- Открывайте и создавайте несколько документов на новых вкладках одного окна, а не в новых окнах.
- Повышает вашу продуктивность на 50% и сокращает количество щелчков мышью на сотни каждый день!
Комментарии (10)
Номинальный 5 из 5
·
рейтинги 1
Содержание
- How to convert date to text in Excel with TEXT function and without formulas
- Using TEXT function in Excel to convert date to text
- Example 1. How to convert date to text strings in different formats
- Example 2. How to convert time to text strings
- Example 3. How to convert the current date to text in Excel
- Example 4. Excel TEXT formula to convert text to date
- Converting date to text with Excel’s Text to Columns wizard
- Convert Excel date to text via Notepad
- Excel Date to String conversion
- 10 Answers 10
- Convert Date to Text in Excel – Explained with Examples
- Convert Date to Text in Excel
- Convert Date to Text using Text Function
- Example 1: Converting a Specified Date to Text
- Example 2: Converting Current Date to Text
- Convert Date to Text using Text to Column
- Convert Date to Text using the Copy-Paste Method
How to convert date to text in Excel with TEXT function and without formulas
by Svetlana Cheusheva, updated on February 7, 2023
In the previous article, we discussed different ways to convert text to date in Excel. If you are looking for a solution to the opposite task — changing an Excel date to text — a few choices are available to you again.
Traditionally, we’ll begin with a formula solution and then explore a couple of non-formula ways.
Using TEXT function in Excel to convert date to text
The Excel TEXT function is specially designed to convert a numeric value to a text string and display it in the format you specify.
The syntax of the Excel TEXT function is as follows:
- value is a numeric value you want to convert to text. This can be a number, a formula that returns a numeric value, or a reference to a cell containing a number.
- format_text this is how you want to format the resulting text value, provided as a text string enclosed in quotation marks.
For example, you can use the following formula to convert a date in cell A1 to a text string in the traditional US date format (month/day/year):
=TEXT(A1,»mm/dd/yyyy»)
As you see in the screenshot above, the value returned by the TEXT formula is aligned to the left, which is the first sign that points to a date formatted as text. Apart from alignment in a cell, there are a few more indicators that can help you distinguish between dates and text strings in Excel.
Example 1. How to convert date to text strings in different formats
Since Excel dates are serial numbers in their nature, the Excel TEXT function has no problem with converting them to text values. The most challenging part is probably specifying the proper display formatting for the text dates.
Microsoft Excel understands the following date codes.
- m — month number without a leading zero
- mm — month number with a leading zero
- mmm — short form of the month name, for example Mar
- mmmm — full form of the month name, for example March
- mmmmm — month as the first letter, for example M (stands for March and May)
- d — days number without a leading zero
- dd — day number with a leading zero
- ddd — abbreviated day of the week, for example Sun
- dddd — full name of the day of the week, for example Sunday
- yy — two-digit year
- yyyy — four-digit year
To display the converted text date exactly the way you want, you can separate the date codes with various delimiters such as dash (-), slash (/), comma (,) colon (:), etc. Here are a few examples:
- «mm/dd/yyyy» — the date format used in the USA, displays as 03/08/2015
- «dd/mm/yyyy» — the date format used by the rest of the world, displays as 08/03/2015
- «dd-mmm-yy» — displays as 08-Mar-15 to avoid any confusion : )
- «dddd, mmmm d, yyyy» — full date, including the day of the week, displays as Sunday, March 08, 2015
For example, if you have a column of US dates in Excel and you need to export them to a .csv file for your UK based partner, you can convert the dates to the UK format, as a courtesy:
Some more formula examples and their results are shown below:
Example 2. How to convert time to text strings
If your date entries display both dates and times and you want to change them to text strings exactly as they are, you included the following time codes in the format_text argument of the Excel TEXT function.
- h — hours without a leading zero, as 0-23.
- hh — hours with a leading zero, as 00-23.
- m — minutes without a leading zero, as 0-59
- mm — minutes with a leading zero, as 00-59
- s — seconds without a leading zero
- ss — seconds with a leading zero
Periods of the day:
- AM/PM — displays as AM or PM
- If not specified, 24-hour time format is used
As you probably noticed, the m codes are used for months as well as minutes, and you might be curious how Microsoft Excel distinguishes between them. If you put «m» immediately after h codes (hours) or immediately before s codes (seconds), Excel understands you want to display minutes rather than a month. Yep, it’s that simple : )
The TEXT function in Excel allows including both date and time codes in the format_text argument, for example:
If you want to convert the time portion only, then put only the time codes, like this:
The results of your TEXT formulas may look similar to this:
Example 3. How to convert the current date to text in Excel
In case you want to convert the current date to the text format, you can use the Excel TEXT function in combination with the TODAY function that returns the current date, for example:
The result of this formula would show up as 08-Mar-2015. If you prefer to display the resulting text string in some other format, please see the date codes discussed in Example 1.
Example 4. Excel TEXT formula to convert text to date
Though the main destination of the TEXT function in Excel is converting numbers to text, it can also perform a reverse conversion, i.e. change text to date. For this, you simply add the double negation (—) to your TEXT formula.
For example, to convert a text string in cell A1 to date, you use the below formula, and then format the cell as a date.
=—TEXT(A1,»mm/dd/yy»)
Note. In the above examples, we used the date and time codes for the English locale of Excel. If you have a different locale, the codes may be different for your language.
Converting date to text with Excel’s Text to Columns wizard
As you’ve just seen, Excel’s TEXT function makes a good job of converting dates to text. But if you are not a big fan of Excel formulas, you might like this solution better.
If you had a chance to read the previous part of our Excel dates tutorial, you already know how to use Text to Columns to change text to date. To convert dates to text strings, you proceed in the same way with the only difference that you choose Text instead of Date on the final step of the wizard.
Note. The Text to Column wizard always converts dates in the default short date format regardless of how the original dates are displayed in your worksheet. You can find more about default date and time formats in the following article: Default date format in Excel.
If the default date format is not what you are looking for, you can jump right to the next solution that lets you convert dates to text strings in any format of your choosing.
If you don’t mind the default format, then perform the following steps:
- In your Excel spreadsheet, select all of the dates you want to change to text.
- On the Data tab, find the Data Tools group, and click Text to Columns.
- On step 1 of the wizard, select the Delimited file type and click Next.
- On step 2 of the wizard, make sure none of the delimiter boxes is checked and click Next.
- On step 3 of the wizard, which is the final step, select Text under Column data format and click Finish.
Tip. If you don’t want the resulting text strings to overwrite the original dates, specify the Destination for the top cell of the new column.
That was really easy, right? The screenshot below demonstrates the result — dates converted to text strings in the default short date format set in your Windows Regional settings, which is «mm/dd/yyyy» in my case:
Convert Excel date to text via Notepad
Another quick no-formula way to turn Excel dates into text strings is using Notepad or any other text editor. Unlike the Text to Columns wizard, it allows you to convert Excel date to text in any format of your choosing.
- In your Excel worksheet, format the dates exactly as you want the text strings to look like.
- Select all of the dates you want to convert and press Ctrl+C to copy them.
- Open Notepad or any other text editor, and paste the copied dates there.
- Notepad automatically converts the dates to the text format. Press Ctrl+A to select all text strings, and then Ctrl+C to copy them.
- Switch back to Microsoft Excel, select the column where you want to insert the text strings and apply the Text format to it. To do this, press Ctrl+1 to open the Format Cells dialog and select Text on the Number tab.
- Finally, select the first cell where you want to insert the text strings and press Ctrl+V to paste them.
The following screenshot shows the result, with the original Excel dates in column B and text entries in column D. Please notice that the converted text strings reflect the original date format with absolute accuracy, except they are left-alighted, as all text values are supposed to be in Excel.
This is how you convert date to text in Excel. Next week we will explorer a few Excel functions to work with weekdays and days of the year. And in the meantime, you may want to check out the previous parts of our comprehensive tutorial to working with dates and times in Excel.
Источник
Excel Date to String conversion
In a cell in Excel sheet I have a Date value like:
I want to convert that Date to Text and also want the Text to look exactly like Date. So a Date value of 01/01/2010 14:30:00 should look like 01/01/2010 14:30:00 but internally it should be Text.
How can I do that in Excel?
10 Answers 10
Here is a VBA approach:
If you are looking for a solution without programming, the Question should be moved to SuperUser.
Here’s another option. Use Excel’s built in ‘Text to Columns’ wizard. It’s found under the Data tab in Excel 2007.
If you have one column selected, the defaults for file type and delimiters should work, then it prompts you to change the data format of the column. Choosing text forces it to text format, to make sure that it’s not stored as a date.
In some contexts using a ‘ character beforehand will work, but if you save to CSV and load again this is impossible.
Couldnt get the TEXT() formula to work
Easiest solution was to copy paste into Notepad and back into Excel with the column set to Text before pasting back
Or you can do the same with a formula like this
I have no idea about the year of publication of the question; it might be old now. So, I expect my answer to be more of a reference for future similar questions after my post.
I don’t know if anybody out there has already given an answer similar to the one I am about to give, which might result -I think- being the simplest, most direct and most effective: If someone has already given it, I apologize, but I haven’t seen it. Here, my answer using CStr instead of TEXT:
Asuming cell A1 contains a date, and using VBA code:
You can, thereafter, manipulate it as any ordinary string using string functions (MID, LEFT, RIGHT, LEN, CONCATENATE (&), etc.)
Источник
Convert Date to Text in Excel – Explained with Examples
Watch video – Convert Date to Text in Excel
Date and Time in Excel are stored as numbers. This enables a user to use these dates and time in calculations. For example, you can add a specific number of days or hours to a given date.
However, sometimes you may want these dates to behave like text. In such cases, you need to know how to convert the date to text.
Below is an example where dates are combined with text. You can see that the dates don’t retain their format and show up as numbers in the combined text.
In such situations, it’s required to convert a date into text.
This Tutorial Covers:
Convert Date to Text in Excel
In this tutorial, you’ll learn three ways to convert the date to text in Excel:
- Using the Text Function
- Using the Text to Column feature
- Using the Copy-Paste method
Convert Date to Text using Text Function
TEXT function is best used when you want to display a value in a specific format. In this case, it would be to display the date (which is a number) in the date format.
Let’s first see how the text function works.
Here is the syntax:
It takes two arguments:
- value – the number that you want to convert into text. This can be a number, a cell reference that contains a number, or a formula result that returns a number.
- format_text – the format in which you want to display the number. The format needs to be specified within double quotes.
Using the Text function requires a basic understanding of the formats that you can use in it.
In the case of dates, there are four parts to the format:
- day format
- month format
- year format
- separator
Here are the formats you can use for each part:
- Day Format:
- d – it shows the day number without a leading zero. So 2 will be shown as 2 and 12 will be shown as 12.
- dd – it shows the day number with a leading zero. So 2 will be shown as 02, and 12 will be shown as 12
- ddd – it shows the day name as a three letter abbreviation of the day. For example, if the day is a Monday, it will show Mon.
- dddd – it shows the full name of the day. For example, if it’s Monday, it will be shown as Monday.
- Month Format:
- m – it shows the month number without a leading zero. So 2 will be shown as 2 and 12 will be shown as 12.
- mm – it shows the month number with a leading zero. So 2 will be shown as 02, and 12 will be shown as 12
- mmm – it shows the month name as a three letter abbreviation of the day. For example, if the month is August, it will show Aug.
- mmmm – it shows the full name of the month. For example, if the month is August, it will show August.
- Year Format:
- yy – it shows the two digit year number. For example, if it is 2016, it will show 16.
- yyyy – it shows the four digit year number. For example, if it is 2016, it will show 2016.
- Separator:
- / (forward slash): A forward slash can be used to separate the day, month, and year part of a date. For example, if you specify “dd/mmm/yyyy” as the format, it would return a date with the following format: 31/12/2016.
- – (dash): A dash can be used to separate the day, month, and year part of a date. For example, if you specify “dd-mmm-yyyy” as the format, it would return a date with the following format: 31-12-2016.
- Space and comma: You can also combine space and comma to create a format such as “dd mmm, yyyy”. This would show the date in the following format: 31 Mar, 2016.
Let’s see a few examples of how to use the TEXT function to convert date to text in Excel.
Example 1: Converting a Specified Date to Text
Let’s again take the example of the date of joining:
Here’s the formula that will give you the right result:
Note that instead of using the cell reference that has the date, we have used the TEXT function to convert it into text using the specified format.
Below are some variations of different formats that you can use:
You can experiment with other formats as well and create your own combinations.
Example 2: Converting Current Date to Text
To convert the current date into text, you can use the TODAY function along with the TEXT function.
Here is a formula that will do it:
This could be useful in dashboards/reports, where as soon as the file is opened (or any changes are made), the date refreshes to show the current date.
Convert Date to Text using Text to Column
If you’re not a fan of Excel formulas, there is another cool way to quickly convert date to text in Excel – the Text to Column feature.
Suppose you have a dataset as shown below and you want to convert these dates into text format:
Here are the steps to do this:
- Select all the cells that contain dates that you want to convert to text.
- Go to Data –> Data Tools –> Text to Column.
- In the Text to Column Wizard, make the following selections:
This would instantly convert the dates into text format.
If you want the date in other formats, use the formula method, or the copy-paste method shown below.
Convert Date to Text using the Copy-Paste Method
This is the fastest way to convert date to text.
Here are the steps:
You May Also Like the Following Excel Tutorials:
Источник
When we work in Excel often, we deal with numbers, text, and date format. Excel completely works on numbers. It will reflect the values based on the formatting you give. For example, the date and Time in excelTime is a time worksheet function in Excel that is used to calculate time based on the inputs provided by the user. The arguments can take the following formats: hours, minutes, and seconds.read more are stored as numbers and converted to readable values based on the formatting.
Look at the below example; the value in cell A1 is 43388. But, if we format it to date, it will show us the value as 15-10-2018.
You can download this Convert Date to Text Excel Template here – Convert Date to Text Excel Template
First, we must right-click on the cell and select the “Format Cells” option.
Then, we need to select the date option as shown below.
Now, the result will be as below.
So, Excel will reflect the numbers based on the formatting we apply.
Table of contents
- How to Convert Date to Text in Excel?
- Where can you Convert Date to Text in Excel?
- Example #1 – Convert Date to Text in Excel using “TEXT” Function
- Example #2 – Convert Date to Text in Excel using “TEXT” Function
- Example #3 – Convert Date to Text Using Text to Column Option
- Example #4 – Convert Date to Text in Excel using Formula
- Recommended Articles
Where can you Convert Date to Text in Excel?
Now, let us see some examples of converting dates to text in Excel.
When we need to convert Date to Text in ExcelYou can convert Date to Text in Excel through the most commonly used method, i.e., the text function or by using: Text-to-Column option, Copy Paste Method and VBA.
read more, we need to use the TEXT function in Excel. As mentioned, time and date in Excel are stored as numbers. However, sometimes we may require showing it as the text string. In such cases, we can use the TEXT function
- TEXT function consists of VALUE & FORMAT_TEXT.
- VALUE: It is the value we need to convert. It is simply the targeted cell. That could be a number, a reference cell that contains a number.
- FORMAT_TEXT: The format we need to provide to the cell, i.e., the targeted cell.
There are multiple date formats available in Excel. The below table will provide a better idea about the different formats and results.
Example #1 – Convert Date to Text in Excel using “TEXT” Function
We have the below values from cell A2 to A10 and convert them to the Date from B2 to B10.
To convert them to date format, in cell B2 write the below formula.
=TEXT(A3,”dd-mm-yyyy”)
Press enter and drag the formula
Example #2 – Convert Date to Text in Excel using “TEXT” Function
Take the below data and join the two columns (A2 & B2) together. For example, get the result as Shwetha Menon’s Birthdate is 14 Dec 2002.
Step 1:
- We must go to cell C2 and apply the below concatenate code.
First, it will show the value as “Shwetha Menon’s Birthday is 37604.” It does not make sense to read it because the formula shows the date as numbers only. Therefore, we need to format the number and apply a date format.
- Then, we must apply the TEXT function to get the correct format. In cell C2, we must use the below formula.
Result:
Note: We can apply different format styles shown in the early table to understand and get different results.
Example #3 – Convert Date to Text Using Text to Column Option
If we do not like formulas in Excel to convert the date to text format, we can use the TEXT TO COLUMN OPTION. Assume we have data from cells A2 to A8.
Now, we need to convert it into text format.
Step 1: We must first select the whole column that we want to convert.
Step 2: Then, we must go to Data > Convert Text to Columns Wizard in Excel.
Step 3: We must ensure that the delimiter is selected and click the “Next” button.
Step 4: Now, the pop-up below will open and uncheck all the boxes and click the “Next” button.
Step 5: We must select the “TEXT” option from the next dialog box. Then, we need to mention the destination cell as =$B$2 and click “Finish.”
Step 6: As a result, it will instantly convert into text format..
Example #4 – Convert Date to Text in Excel using Formula
We must use the formula method to convert the number to a date format. Assume we have the below data in our Excel file.
Formulas you need to know to convert them to YYYY-MM-DD are DATE, LEFT, RIGHT & MID functions. Moreover, the formula is.
Date: Date Function in ExcelThe date function in excel is a date and time function representing the number provided as arguments in a date and time code. The result displayed is in date format, but the arguments are supplied as integers.read more formats it into Year-Month-Day format.
Left: LEFT Function in ExcelThe left function returns the number of characters from the start of the string. For example, if we use this function as =LEFT ( «ANAND»,2), the result will be AN.read more will take the first portion for year format. It takes 4 first 4 characters in year format.
Mid: MID Function will take the middle part of the data for month format. It takes the middle 2 characters for a month format.
Right: RIGHT Function in ExcelRight function is a text function which gives the number of characters from the end from the string which is from right to left. For example, if we use this function as =RIGHT ( “ANAND”,2) this will give us ND as the result.read more will take the last part for Day format. Takes the last 2 characters for Day format.
Now, we must go ahead and apply the formula to get the date format.
Now, let us elaborate on each part.
Part 1: LEFT (B2, 4) this means, in cell B2, take the first four characters. i.e., 2017
Part 2: MID (B2, 5, 2) this means, in cell B2, starting from 5th character, select two characters. i.e., 08.
Part 3: RIGHT (B2, 2) this means, in cell B2 from the right side, select two characters. i.e., 15
The Date function will combine all these and give you the value below. Next, drag and drop the formula for the remaining cells.
Recommended Articles
This article is a guide to Convert Date to Text in Excel. Here, we discuss converting date to text in Excel using three methods – 1) Text Function and 2) Text to Column Option 3) Formula Method, along with Excel examples and downloadable Excel templates. You may also look at these useful functions in Excel: –
- Excel Separate Text
- Add Text in Excel FormulaText in Excel Formula allows us to add text values to using the CONCATENATE function or the ampersand (&) symbol.read more
- Text to Columns in ExcelText to columns in excel is used to separate text in different columns based on some delimited or fixed width. This is done either by using a delimiter such as a comma, space or hyphen, or using fixed defined width to separate a text in the adjacent columns.read more
- MONTH Excel Function