Date and text excel

Excel for Microsoft 365 Excel for Microsoft 365 for Mac 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 More…Less

Suppose you want to create a grammatically correct sentence from several columns of data for a mass mailing or format dates with text without affecting formulas that use those dates. To combine text with a date or time, use the TEXT function and the & (ampersand) operator.

Example

Examples to show how formulas can combine text with date and time values

The TEXT function requires two arguments (that is, items between its parentheses). The first argument is a value, such as a date or a number. This value is converted to a text value. The second argument, format_text, is a special string that Excel recognizes and uses to display the converted text value in a format that you specify. In the second and third examples, the dates in B3 and B4 are converted to text and then is displayed in two different formats: “d-mmm-yyyy” (resulting in June 4, 2010) and “mmmm d, yyyy.” (resulting in Jun-07- 2010).

Need more help?

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.

Convert Date to Text - Problem Dataset

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:

Convert Date to Text - Problem Dataset

Here’s the formula that will give you the right result:

=A2&"'s joining date is "&TEXT(B2,"dd-mm-yyyy")

Convert Date to Text - Joining date example

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:

Convert Date to Text - sample formats

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 - 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:

Convert Date to Text - text to column 1a

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.Convert Date to Text - text to column 2
  • In the Text to Column Wizard, make the following selections:

This would instantly convert the dates into text format.

Convert Date to Text - text to column 6

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:

Convert Date to Text - copy paste 5

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?

How to Convert Date to Text in Excel?

The conversion of the date to text is very easy and simple. There are four simple ways to convert dates to text in Excel:

  1. Using the TEXT function (most commonly used)
  2. Using the TEXT to COLUMN option
  3. Using the copy-paste method
  4. Using VBA

Use of Date to Text in Worksheet

Excel Text functionTEXT function in excel is a string function used to change a given input to the text provided in a specified number format. It is used when we large data sets from multiple users and the formats are different.read more is commonly used to convert a numeric value to a text string and display it in the format you specify so we can use it to convert date to text in Excel format.

Table of contents
  • How to Convert Date to Text in Excel?
    • Date to Text Function in Excel
    • #1 Using Text Function
      • Example #1
      • Example #2
    • #2 Using Text to Column
    • #3 Using Copy Paste Method
    • #4 Using VBA
    • Things to Remember
    • Recommended Articles

Date to Text Function in Excel

The TEXT formula in excelTEXT function in excel is a string function used to change a given input to the text provided in a specified number format. It is used when we large data sets from multiple users and the formats are different.read more is as follows:

Text Formula in Excel

  • Value: It is a numeric value you want to convert to text. It 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.

Using the TEXT function to convert dates to text in Excel requires a basic understanding of the formats we can use.

In the case of dates, there are four parts to the format:

  • day format
  • month format
  • year format
  • separator

You can download this Convert Date to Text Excel Template here – Convert Date to Text Excel Template

#1 Using Text Function

Example #1

Apply the formula =A4&”‘s joining date is “&TEXT(B4,”dd-mm-yyyy”)

Date to Text in Excel Example 1

To get the below output.

Date to Text in Excel Example 1-1

Example #2

You can also convert the current date to text by the below formula:

=”Today is “&TEXT(TODAY(),”dd/mm/yyyy”)

Date to Text in Excel Example 2

To get the below output.

Date to Text in Excel Example 2-1

#2 Using Text to Column

Suppose we have a dataset, as shown below, and we want to convert these dates into textTo convert a date to text in Excel, right-click on the date cell and select the format cells option. A new window will open. You can convert the date to text by selecting the desired format from a list of options.read more format:

Date to Text in Excel Example 3

Below are the steps to convert the date into text:

  1. First, we must select the data and go to “Data,” then “Data Tools,” and Text to Column in Excel.

    date to text in excel example 3-1

  2. Press “Next” and uncheck all “Delimiters.”

    date to text in excel example 3-2

  3. Then, we must select the location and click on the “Finish,” as shown below.

    date to text in excel example 3-3

    The output will be as follows:

    date to text in excel example 3-4

#3 Using Copy Paste Method

Consider the data set of the joining date.

date to text in excel example 4

  • First, copy the data. Then, open a notepad and paste it there. As soon as you paste the dates into the notepad, it automatically gets converted into text.
  • Now switch back to Excel and select the cells where you want to paste these dates.
  • Then, we must go to “Home” then “Number” with the cells selected and select the “Text” format (from the drop-down).
  • Finally, paste the date as text.

date to text in excel example 4-1

date to text in excel example 4-2

#4 Using VBA

Suppose we have the text in sheet1 and the H2 cell, then apply the date to the text using the below VBA codeVBA code refers to a set of instructions written by the user in the Visual Basic Applications programming language on a Visual Basic Editor (VBE) to perform a specific task.read more.

Sub Datetotexts ()

Dim c As Range

For Each c In Selection

c.Value = Format(c.Value, “dd.mm.yyyy”)

Next c

End Sub

Things to Remember

  • It must be left-aligned by default.
  • If several text dates are selected, the Status BarAs the name implies, the status bar displays the current status in the bottom right corner of Excel; it is a customizable bar that can be customized to meet the needs of the user.read more only shows “Count.”
  • There may be a leading apostrophe visible in the formula bar.

Recommended Articles

This article is a guide on How To Convert Date to Text in Excel. Here, we discuss the top 3 methods to convert the date to text: 1) Text Formula, 2) Text to Column, and 3) Copy Paste Method, along with examples and a downloadable Excel template. You may also look at these useful functions in Excel: –

  • How to add Leading Zeros in Excel?
  • Char Function In Excel
  • CODE Excel Function

На чтение 5 мин Просмотров 4.3к. Опубликовано 19.02.2022

Excel сохраняет даты в виде порядковых номеров. Человеку невозможно их читать и понимать, но, таким образом, можно использовать их в функциях расчета, к примеру добавить к дате или времени какое-то количество времени (день, год и так далее).

Но, довольно часто, вам может быть нужно использовать даты в одних ячейках с текстом, так сказать, объединять.

На картинке пример объединения даты с текстом в одной ячейке. Видите как выглядит наша дата? Это формат порядкового номера Excel.

Именно в таких ситуациях вам может понадобиться привести дату в «читаемый» формат.

Содержание

  1. Переводим дату в текстовый формат
  2. Как привести указанную дату в текстовый формат
  3. Как привести текущую дату в текстовый формат
  4. Переводим дату в текстовый формат с помощью функции «Текст по столбцам»
  5. Переводим дату в текстовый формат с помощью копирования и вставки

Переводим дату в текстовый формат

Когда нам нужно привести дату в определенный формат (к примеру, 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.

Dates and times in Excel are stored as serial numbers and converted to human readable values on the fly using number formats. When you enter a date in Excel, you can apply a number format to display that date as you like. In a similar way, the TEXT function allows you to convert a date or time into text in a preferred format. For example, if the date January 9, 2000 is entered in cell A1, you can use TEXT to convert this date into the following text strings as follows:

=TEXT(A1,"mmm")            // "Jan"
=TEXT(A1,"dd/mm/yyyy")     // "09/01/2012"
=TEXT(A1,"dd-mmm-yy")      // "09-Jan-12"

Date format codes

Assuming a date of January 9, 2012, here is a more complete set of formatting codes for date, along with sample output.

Format code Output
d 9
dd 09
ddd Mon
dddd Monday
m 1
mm 01
mmm Jan
mmmm January
mmmmm J
yy 12
yyyy 2012
mm/dd/yyyy 01/09/2012
m/d/y 1/9/12
ddd, mmm d Mon, Jan 9
mm/dd/yyyy h:mm AM/PM 01/09/2012 5:15 PM
dd/mm/yyyy hh:mm:ss 09/01/2012 17:15:00

You can use the TEXT function to convert dates or any numeric value to a fixed text format. You can explore available formats by navigating to Format Cells (Win: Ctrl + 1, Mac: Cmd + 1) and selecting various format categories in the list to the left. Also see: Excel custom number formats.

I have an Excel file which has a column formatted as date in the format dd-mm-YYYY.

I need to convert that field to text. If I change the field type excel converts it to a strange value (like 40603).

I tried the text function but it gives me Error 508.

Any help?

Lance Roberts's user avatar

Lance Roberts

22.2k32 gold badges112 silver badges129 bronze badges

asked Apr 3, 2012 at 12:04

brpaz's user avatar

2

You don’t need to convert the original entry — you can use TEXT function in the concatenation formula, e.g. with date in A1 use a formula like this

="Today is "&TEXT(A1,"dd-mm-yyyy")

You can change the «dd-mm-yyyy» part as required

answered Apr 3, 2012 at 12:20

barry houdini's user avatar

barry houdinibarry houdini

45.5k8 gold badges63 silver badges80 bronze badges

2

You can use TEXT like this as part of a concatenation

=TEXT(A1,"dd-mmm-yy") & " other string"

enter image description here

Community's user avatar

answered Apr 3, 2012 at 12:23

brettdj's user avatar

brettdjbrettdj

54.6k16 gold badges113 silver badges176 bronze badges

If that is one table and have nothing to do with this — the simplest solution can be copy&paste to notepad then copy&paste back to excel :P

answered Apr 3, 2012 at 12:10

AlexHalkin's user avatar

AlexHalkinAlexHalkin

1,08814 silver badges33 bronze badges

2

Здравствуйте. Сегодня мы научимся преобразовывать дату в текст в Excel. Сначала давайте изучим как Эксель хранит информацию о дате. Программа хранит ее как число, равное количеству дней от 01.01.1900 года, к примеру 01.01.2016 это 42 370. Нам же нужно преобразовать это число в текст, к примеру что бы 01.01.2016 отразилось как 1 янв 2016 в текстовом формате. Это можно сделать при помощи встроенной формулы ТЕКСТ.

Как преобразовать дату в текст в Excel

Синтаксис формулы:

ТЕКСТ(значение; формат)

где значение — это ссылка на ячейку с датой, либо сама дата.
      формат — Численный формат в виде текстовой строки в кавычках.

Варианты форматов для приобразования даты:

М Отображение месяца в виде числа без начального нуля.
ММ Отображение месяца в виде числа с начальным нулем, если он необходим.
МММ Отображение сокращенного названия месяца (янв–дек).
ММММ Отображение полного названия месяца (январь–декабрь).
МММММ Отображение месяца в виде одной буквы (Я–Д).
Д Отображение дня в виде числа без начального нуля.
ДД Отображение дня в виде числа с начальным нулем, если он необходим.
ДДД Отображение сокращенного названия дня недели (пн–вс).
ДДДД Отображение полного названия дня недели (понедельник–воскресенье).
ГГ Отображение года в виде двузначного числа.
ГГГГ Отображение года в виде четырехзначного числа.

В нашем случае введите в ячейку A1 нашу дату 01.01.2016, а в ячейку B1 формулу =ТЕКСТ(A1;»ДД МММ ГГГГ»), тем самым Вы получите в ячейке В1 текст «01 янв 2016«, который мы и хотели получить.

Оставляйте комментарии к статье ниже.

Как-то пришлось создать базу в Excel по дням на весь год. Для дальнейшего управления мне надо было перевести дату в текст. 

Дата в текст

Можно было просто выставить начальную дату и потом протянуть ее, но дело в том, что когда ячейка обладала типом «Дата», появлялись кое-какие глюки. Пришлось перевести ее в текстовый тип. И тут снова проблема – если формат ячейки типа «Дата» переводить в тип «Текст», выходит вот такая штука:

Даты в Эксель

Не знаю, как всем, а мне легче было накидать маленький макрос.

Visual Basic в Excel

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

Макросы в Экселе

Разбор макроса. В нем я использую три переменные:

  • newdate – тип «Дата» для перебора даты,
  • dateWrite – тип «Текст» для перевода даты в текст,
  • а – число для смены ячеек.

а = 2 – первоначальный номер ячейки. Затем переменной newdate присваиваем первоначальную дату «1 января 2021 года» – #1/1/2021#, запускаем цикл, пока год даты не изменится на 2022. 
В цикле переменной dateWrite присваивается дата, записываем в ячейку значение dateWrite, затем номер ячейки мы увеличиваем на один, а дату – на один день. И цикл запускается заново.

Текс полного макроса:

Sub Newyear()
    Dim newdate As Date
    Dim dateWrite As String
    a = 2
    Date = #1/1/2021#
    newdate = Date
    dateWrite = year(newdate)
    Sheets(dateWrite).Select
    Do
        dateWrite = newdate
        Range(«A« & a).Value = dateWrite
        a = a + 1
        newdate = newdate + 1
    Loop Until year(newdate) = 2022
    
End Sub

Прочел статью про функцию сегодня(), вспомнил про этот метод и решил поделиться им. Это моя первая статья, так что строго не судите. Может, кому и пригодится.

Понравилась статья? Поделить с друзьями:
  • Dataset to excel sheet
  • Datanumen word repair что это
  • Datanumen word repair скачать торрент
  • Decide which category each word belongs to 6 класс
  • Decide what the following words and word