Open In App

How To Convert Date To Number String Or Text Format In Excel?

Last Updated: 16 Nov, 2022

A

Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

Excel’s built-in date system by default supports dates between January 1, 1900, and December 31, 9999. In this range, the numbers start at 1 and increase by 1 each time. In addition to text and numeric data types, Excel also allows dates that are internally stored as serial numbers. In Excel, the date format is typically recognized by default. However, Excel also allows you to input date format by choosing the cell and pressing (Ctrl+;).

Methods to Convert Date to Number String

DATEVALUE Function

Syntax: =DATEVALUE (date_text)

Where date_text is the only argument

Datevalue-function

DATEVALUE Function

Cell Formatting

Step 1: Once the cell with the value has been chosen, click the home tab and choose the NUMBER or TEXT option.

Choosing-number-option-from-home

 

Step 2: The cell format then changes into the original serial number internally stored by Excel.

Cell-format-changes

 

Note: The first serial number stored by excel is of date 01/01/1900.

First-serial-number-stored

 

Methods to Convert Date to Text

TEXT Function

It is used to convert a date into a specified text format. 

Syntax: =TEXT(value, format_text)

For today’s date: =TEXT(TODAY(), format_text)

Where value: The value that needs to be converted. This could be a numeric cell reference or value, or a numeric value returned by a formula.
format_text: The format to display the number. It should be in double quotes.

There are different formats possible for the day, month, year, and separator.

 

Value

Meaning

Day
  1. d
  2. dd
  3. ddd
  4. dddd
  1. Number without leading 0 (Eg: 6)
  2. Number with leading 0 (Eg: 06)
  3. Day in short form (Eg: Mon)
  4. Day in full form (Eg: Monday)
Month
  1. m
  2. mm
  3. mmm
  4. mmmm
  1. Month number without leading 0 (Eg: 8)
  2. Month number with leading 0 (Eg: 08)
  3. Month three-letter abbreviation (Eg: Jan)
  4. Month full form (Eg: January)
Year
  1. yy
  2. yyyy
  1. Year in two-digit (Eg: 16)
  2. Year in four-digit (Eg: 2016)
Separator
  1. / (slash)
  2. – (dash)
  3. . (dot)
  4. , (comma)
  1. 10/10/2020
  2. 10-10-2020
  3. 10.10.2020
  4. 10 Oct, 2020

Text-function-applied

 

Formula-for-date-to-text

 

Adding Apostrophe

An apostrophe can be added in the formula bar where the date is entered to make it text. In some excel versions, adding space in the formula bar adds the apostrophe itself.

After-adding-apostrophe-in-formula-bar

 

Format Cell Option

Step 1: Either select the cells, right click and click on the FORMAT CELL option, or in the Home Tab, select Cell then format and click on the FORMAT CELL. 

Selecting-format-cell-option

 

Step 2: In the Custom option of the Number Tab, specify the format. Click Ok.

Specifying-format

 

Format-cell-result

 

Text to Column

Step 1: Select the cells. Go to the Data tools in the Data tab. Click on Text to Column. 

Selecting-text-to-column-from-data-tools

 

Step 2: In the next widget, choose delimited and click next.

Choosing-delimited-option

 

Step 3: In the next screen, deselect all the delimiters and click next. 

Deselecting-delimiters

 

Step 4: Finally, enter the destination cell number and click finish.

Entering-destination-cell

 

Note: The Text to Column tool will always convert dates to the short date format according to your system.

Text-to-column-result

 

Copy-Paste Through Notepad

Step 1: Copy the selected cells with date and paste them to Notepad. The dates are instantly transformed into text when pasted into the notepad.

Pasting-content-in-notepad

 

Step 2: The target cells should be chosen and changed to the Text Cell Format in the next step.

Target-cells-changed-to-text-format

 

Step 3: Finally, paste the content in the target cells. It will be in the text format as shown in the figure.

Notepad-result

 

VBA

VBA is located in Excel’s “Developer” tab.

Step 1: The “Developer” tab must first be enabled before it can be accessed from the ‘File’ option.

Clicking-options-from-file-menu

 

Step 2: Select Customize Ribbon from Options. Check the Developer box from the right menu.

Go-to-customize-ribbon

 

VBA is now enabled. We can access VBA Editor through the Developer tab or the keyboard shortcut ALT + F11.

VBA-enabled

Visual Basic from Developer Tab

Step 3: Insert Module in the workbook. 

Inserting-module

 

Step 4: Add the following code to convert Date to Text. Name the function ToText in the blank next to General. Click on Run Button.

Sub toText()
Dim d as Range
For Each d in Selection
d.Value = Format(d.Value, “dd.mm.yyyy”)
Next d
End Sub

Adding-code-to-text-function

 

Step 5: In the next Dialog Box, click No and change the Extension to “Excel Macro-Enabled Workbook” to save it.

Saving-macro-enabled-workbook

 

Step 6: Macros in VBA are a collection of codes that form a programming language. In the excel sheet, add a macro button for the above code by adding a shape/ text box. Add the text “Convert to Text” in the shape.

Inserting-shape

 

Step 7: Right-click the text box and choose “Assign Macro” for the toText code to make it a clickable button. 

Assigning-macro

Step 7: Assign macro to the button

Finally, using the created button, we can change the date to text in the format specified in the code.

Result-through-vba

 



A

News
Improve
Discuss
Do you want to advertise with us?Click here to know more

How to Convert Text to Date in Excel

article_img
Have you ever found yourself staring at a column of dates in Excel, only to realize they’re formatted as text? It's a common problem that can hinder your data analysis and reporting tasks. Fortunately, converting text to date in Excel is straightforward. If you're looking to use the Text to Columns feature or need to convert a number to date in Excel, this article will walk you through the process step-by-step. Learn how to seamlessly convert text to dates, ensuring your spreadsheets are accurate and functional. Discover the best methods for Excel convert number to date and Excel convert text to number, making your data work for you. Let’s dive in and transform those text entries into usable date formats!How to Convert Text to Date in ExcelTable of ContentHow to convert number to date in ExcelHow to Convert Text to Date in ExcelHow to convert text to columns in ExcelWhat does it mean to convert text to date in ExcelConverting text to date in Excel means transforming date information stored as text strings into a format that Excel recognizes as a date. This transformation is crucial for enabling date-specific calculations, formatting, and sorting. Text dates, which are treated as pl
Read More

How to Change Date Format in Excel

article_img
You know that Excel is one of the best spreadsheets you can work on. Excel is the first preference of many users to create an impressive data set. Have you tried filling in the Date on the sheet? Date with the data is a common practice done by users in Excel to get information timeline. To help organize data in an Excel worksheet, we will discuss four easy yet effective ways to change the date format in Excel. How to Change Date Format in Excel? What is the Date Format in Excel?In Excel, a date is displayed depending on the user's chosen format. You may choose from the different formats available in your Excel worksheet, or you can even create a customized date format per your requirements. The default date format is usually shown in your system's 'Control Panel.' However, you can even change these default settings if necessary. Change Date Format in ExcelWhen you input a date in Microsoft Excel, the program will format it according to the default date settings. For example, if you want to enter the date April 14, 2024, the date could appear in either long date format, or short date format, as 14-Apr, April 14, 2024, 14 April, or 04/14/2024, all depending on your settings. You may
Read More

How to Create a Custom Date Format in Excel?

article_img
Date formatting is very important when you prepare any set of data, then there are different types of formatting used for different categories, which are different from our normal formatting which is dd/mm/yyyy. When you enter any date in MS-Excel then excel considers it as the default format of date as your computer has, but you can change their format in numerous ways, and also you can make your own custom format of a date. Such as 14-Dec, December 14, 2023, 14/12/2023, and may more depending on individual choices, you can change it. Here we are going to show the different ways to format a Date. Let's understand it in a better way by taking an example, Step 1: Open MS Excel and save with any name. Here we are going to save it by "Date Format" name. Step 2: Take any date, like here we are taking 15/04/2001, which is in the format of mm-dd-yyyy and also it is the normal format of a date. Step 3: You can change the format by selecting that particular date cell, and press ctrl+1, then a new "format cells" window will open. From this format window, you can choose date formatting according to your needs. If you want that date to be on 15 April 2001 format, then choose dd mont
Read More

Custom Format to Show Units Without Changing Number to Text in Excel

article_img
Microsoft Excel is a great software that is used by individuals to store data in the form of spreadsheets in a formatted manner. Microsoft Excel allows us to store a variety of data such as characters, text, numbers, decimals, date, time, etc. Since Excel is a smart tool, it automatically identifies the data type of the records and places them accordingly inside the cell based on its default convention. But, there can be scenarios in which we want to store data which is actually of kind number but along with some unit which is generally text. Let's say we want to store unit values like 10 Litres (10 L), 20 Litres (20 L) or we want to store distance traveled like 2 km, 5 km. In such cases, when we input let's say 2 km or 20 L inside a cell then it will be treated as a text by Excel automatically. But, what if we want these records to be actually stored as numbers inside the cell, so that we can perform some functional operations on these numbers such as calculating the total amount of currency or calculating the total distance traveled. In such cases, mathematical formulas cannot be performed on text values. Hence, we are required to change those texts back to numbers. In this artic
Read More

How to Calculate End Date from Start Date and Duration in Excel?

Excel is a powerful data visualization and analysis software, which uses spreadsheets for managing, storing, and visualizing a large amount of data. A cell, a rectangular block is used to store each unit of data. This tool can be used to visualize trends or compare data by creating graphs, or get insights from the data using functions and formulas. It is primarily used for accounting purposes but can be used by anyone for many different tasks as per the requirements. Let's see how to calculate the end date from the start date and duration. Calculate the end date from the start date and duration (weeks) To calculate the end date from the start date and the number of weeks(duration), use the below formula: =IF(start_date, start_date+(duration_in_weeks*7),"") This formula will add (week * 7) days to the start date, as a week has 7 days. For purpose of demonstration use the below data to calculate the end date: Step 1: Apply the formula, Step 2: Drag the fill handle over to the data range. Step 3: To change the value into date format, click the Home tab, and choose Short Date from the General drop-down list. Output Calculate the end date from the start date and duration (mont
Read More

How to Combine Text with Date or Time in Excel?

article_img
Microsoft Excel allows its users to store and manage different varieties of data in the form of rows and columns and store it inside an Excel workbook. Since Microsoft Excel allows its users to not only store data but also manipulate that data later on as per their needs. Combine Text with Date or Time in Excel Let's assume a scenario where a user is having data in two different columns. In the first column, the user has some text and in the second column, the user has either date or time values and the user wants to manipulate this data in such a way that he/she can combine the data of both of these columns in a third column. Text Date Final Form MS Dhoni was born on07/07/1981MS Dhoni was born on 07/07/1981Virat Kohli was born on 05/11/1988Virat Kohli was born on 05/11/1988 Now, we can observe that our goal is to append data of one column with data of another column. Microsoft Excel provides us with two useful ways using which we can combine these two elements. The first one is the Ampersand (&) symbol/operator and the second one is the CONCAT() function. Method 1: Combining text with date/time using Ampersand (&) operator We can use the & operator to combine two elem
Read More

How to Convert Data from Wide to Long Format in Excel

article_img
Do you find your Excel data hard to analyze? Sometimes, changing the way your data is arranged can make it much easier to understand. Converting data from wide format to long format can help you organize your spreadsheet better, making it simpler to spot trends and patterns. This method is useful for business reports, school projects, and more. In this guide, we’ll show you, step-by-step, how to change your data from wide to long format in Excel. Let’s make your data work for you! Convert Data from Wide to Long Format in MS ExcelReshape data is an important step in Data analysis. Most of the time the raw data will be unstacked. The below example of the data presents each quarter in a column. Before doing further analysis, the user may need to know stack/pivot the data. In this article, we explain how to convert data from wide to long format in Excel. So we have a table that contains some data as shown in the image below: Sample DataNow we convert the data from wide to long format as shown in the below image:  So to this, we have to follow the following steps: Step 1: In Excel, press Alt+D+P to popup PivotTable and PivotChart WizardStep 2: Select “Multiple Consolidation ranges“ then
Read More

How to Convert Scientific Notation to Text or Number in Excel?

article_img
Microsoft Excel is a universal software tool that is used by companies throughout the world to store data/numbers in the form of a spreadsheet. Excel not only helps users to store the data into spreadsheets, but it also gives us the freedom to use multiple smart features to manipulate, organize and analyze the raw data. Some of these helpful smart features also create an issue in a few cases. In this article, we are going to read about one such issue and how we can resolve that issue. But, before we go on to identify the issue and resolve it let's understand how Excel generally treats data and stores it inside the cells. Convert Scientific Notation To Text Or Number In Excel Suppose, we want to store the salary of five people in an Excel spreadsheet. It can be done as: Salary record of five employees in a company If we carefully observe the picture shown above, we can notice, all the cell constituents like "Employee Name", "Ram", "Rajni", "Sameer", etc. are identified by Excel as text and are generally stored with left alignment inside the cell whereas if we notice constituents like 50000, 75000, 45000, etc. Excel automatically understands and treats them as numbers and all of the
Read More

S

Custom Excel Number Format

article_img
MS Excel is a very important tool for businesses as well as for individuals with very useful features and tools. It is a market leader in spreadsheet editing and managing software. MS Excel contains many inbuilt number formats that can be used as per the needs of the user, however, sometimes users may need specific custom number formats that are not available in Excel by default. Custom Excel Number Format For example, if we want to round a decimal number to one digit after the decimal point, if we consider the number 44.64 we can use the custom number format ##.# to convert it to 44.6. If you want to represent number 347523450 using the Indian number system, of crores, lakhs, and thousands you can use the custom number format ##\,##\,##\,### to convert it to 34,75,23,450. First, let's consider the list of the following numbers given below : To Convert these numbers into our required format we have to execute the following steps: Step 1: Drag and select the numbers whose format has to be changed using the cursor. Step 2: a) Go to home and click on format. b) Then click on Format Cells. Or a) Right-Click and choose Format Cells. Format Cells Dialog Box appears. Step 3:
Read More

How to Format Numbers in Thousands and Millions in Excel?

article_img
Microsoft Excel allows its users to store raw data in a well-structured format in a spreadsheet. The spreadsheets consist of numerous cells in the form of rows and columns in which an individual can store data. An Excel spreadsheet can store different types of data such as numbers, characters, strings, dates, date-time, etc. A lot of the time when we store a large amount of data inside an Excel spreadsheet and when we want to look out for a particular entity within that spreadsheet it becomes quite cumbersome to get information about that in a single glance. In order to manage such situations and avoid such scenarios, a user must always think about keeping the records formatted in such a way that it looks easier to the human eyes and conveys much more information in a glance. Suppose, we have an Excel spreadsheet containing data about the net worth of different persons in a city or sales of a particular company as shown in the below image. Now, when we give these extremely large raw numbers to any individual, it would be really hard for that person to digest these numbers in one glance. To make it more convenient, we can write these numbers in a particular way like writing the num
Read More
three90RightbarBannerImg