How to Combine Text with Date or Time in Excel?
Last Updated :
07 Mar, 2022
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 on | 07/07/1981 | MS Dhoni was born on 07/07/1981 |
Virat Kohli was born on | 05/11/1988 | Virat 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 elements. Let's see this with an example.
Using (&) operator to combine records
We can see the formula =A1&" "&B1 in the formula bar, where A1 and B1 are the cell references for both the elements and &" "& in the middle signifies joining both the elements with a space in-between. Hence, our final output can be observed in the C1 cell. This method is useful when the elements we want to combine are of type text. But when we want to combine a text with a date or time then an ambiguous output will be shown this method because Excel treats date/time values as a number in the back-end. We can observe the image given below:
We can notice from the above image that the date value is treated like a number implicitly by Excel in the backend and hence a different value is shown. Now, to resolve this error, we can convert the date value to a text itself and then join both these elements together. The Date type can be converted to a text using the TEXT() function. In the TEXT() function we pass our cell reference as the first parameter (here B2) and the format of our date as the second parameter.
After converting the date element to the text type we can easily join both the elements and the final result can be seen in the image given above.
Method 2: Using the CONCAT() function
The CONCAT() function can be used to concatenate multiple texts with one another. The syntax for the CONCAT() function is given as:
=CONCAT(text1,text2,text3,....)
Where text1, text2, text3, etc. are different text elements.
Now, as we can see this function can also concatenate only text values, hence we need to convert the date element to the text type and then pass that converted value as a parameter inside the CONCAT() function. We can convert the date element to text type using the same method that we saw in the previous method. Both the elements can be contacted using the CONCAT() function as:
Concatenating text with a date element using the CONCAT() function
In the formula, =CONCAT(A2," ",TEXT(B2, "dd/mm/yyyy")), A2 and B2 are the cell references of the elements. The second parameter " " represents a space since we want to join both the elements separated by a space.
Similar Reads
How to Convert Text to Date in Excel 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
5 min read
How To Merge Cells in Excel Without Losing Data Merging cells in Excel is a simple but powerful way to organize and format your spreadsheets. Whether you're looking to combine two cells, center text across a group of cells, or merge multiple rows or columns, knowing how to merge cells in Excel is a must-have skill. In this guide, weâll walk you t
11 min read
How to Concatenate with a Line Break in Excel? Excel is a powerful tool to store, manage, and visualize large amounts of data. This tool is usually used by accounting professionals for the analysis of financial data but can be used by anyone to manage large data. Data is entered into the rows and columns. And then, various formulas and functions
3 min read
How To Convert Date To Number String Or Text Format In Excel? 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 da
4 min read
How to Remove Time from Date/Timestamp in Excel? Timestamp stores a combined Date and Time value. In this article, we will look at how we can create Timestamp and remove Time from Date in Excel. To do so follow the steps below: Step 1: Formatting data to create a timestamp. Select the cell, right-click on it choose Format Cells... Step 2: Then in
3 min read
How to separate date and time in R ? In this article, we are going to separate date and time in R Programming Language.  Date-time is in the format of date and time (YYYY/MM/DD HH:MM:SS- year/month/day Hours:Minute:Seconds). Extracting date from timestamp: We are going to extract date by using as.Date() function. Syntax:  as.Date(data
2 min read
How to Add or Subtract Dates in Excel New to Excel and seeking a way to add or subtract dates, then this guide on how to add or subtract dates in Excel will expalin you the right way to manage project timelines, schedules, or due dates. Weâll break down simple steps to add or subtract dates using easy formulas and time-saving tips.How t
5 min read
How to create filename containing date or time in Python Prerequisite: DateTime module In this article, we are going to see how to create filenames with dates or times using Python. For this, we will use the DateTime module. First, import the module and then get the current time with datetime.now() object. Now convert it into a string and then create a f
2 min read
How to Change the Case of Texts in Microsoft Excel Changing the case of text in Microsoft Excel is a powerful yet often overlooked feature that can help you standardize your data and improve readability. Whether you need to convert text to uppercase, lowercase, or capitalize each word, mastering this skill can significantly enhance your data present
6 min read