How to Merge Date and Time in Excel
In Excel, a date is represented by an integer and time is represented by a decimal. If you want to merge both date and time in a single cell, there are two easy methods you can follow:
How to Merge Date and Time in Excel
Using Ampersand to Merge Date and Time:
- To merge date and time using this method, follow these steps:
- Edit the cell where you want to merge date and time and type “=”.
- Refer to the cell that contains the date (for example, A2).
- Type “&” as the concatenation operator.
- Refer to the cell that contains the time (for example, B2).
- Press Enter to get the combined date and time.
Excel will convert the combined value to a real number, which you can format as a date and time by selecting the appropriate format from the formatting dropdown.
Using the TEXT Function to Concatenate Date and Time:
- To merge date and time using this method, follow these steps:
- Use the TEXT function twice in combination with CONCAT. In the first part, refer to the cell that contains the date and specify the desired date format. In the second part, refer to the cell that contains the time and specify the desired time format.
- Use CONCAT to combine the two values with a space in between.
Here is an example formula:
=TEXT(A2,”DD-MMM-YYYY”)&” “&TEXT(B2,”HH:MM:SS”)
This formula retrieves the date value from cell A2 and formats it as “DD-MMM-YYYY”. It also retrieves the time value from cell B2 and formats it as “HH:MM:SS”. The two values are then combined using CONCAT, with a space in between.
If you want to use a different date or time format, you can modify the format codes within the TEXT function.