To merge the date and time in a single column you have to use the “INT” function along with the “MOD” function in Microsoft Excel 2010.
Before we use the formulas together you should know about both the functions individually.
INT: - This function is used to round a number down to the nearest integer.
Syntax of “INT” function: =INT (number)
Example:Cell A1 contains the
=INT (A1), function will return 456
MOD: - This function is used to return the remainder after a number is divided by a divisor.
Syntax of “MOD” function: =MOD (number, divisor)
Example:Cell A1 contains 45 and A2 contains 16
=MOD (A2, A3), function will return 13
Let’s take an example and understand how we can add date and time in a single cell without losing the time part of the data.
I have a date in cell A2 and the time in cell B2. To merge date and time in a cell follow the below mentioned steps:-
- Select the cell C2 and write the formula.
- =INT (A2) +MOD (B2, 1)and press enter on the keyboard.
- The function will merge the date and time without losing the time part.
So in this way, we can merge both the cells ensuring that the time part is correctly reflected in the merged cell.