To change a date and time stamp to just the time in Excel, the fastest way is to change the cell format to "Time" via the Home tab. If you need to permanently remove the date data for calculations or exports, use the =MOD(A1,1) formula. This process isolates the fractional part of the Excel serial number, which represents the time of day.
Excel stores dates as whole numbers and times as decimals. For example, "January 1, 2024, 12:00 PM" is stored as 45292.5. By removing the whole number (the date), you are left with only the decimal (the time). Depending on whether you just want the cell to look like a time or you want the date data actually gone, you will choose a different method below.
What You'll Need
- Microsoft Excel (any modern version)
- A dataset containing cells with both date and time (timestamps)
Step-by-Step
Depending on your goal, choose one of the following three methods. Note that menu labels may differ slightly based on your version of Excel or regional settings.
Method 1: Changing the Visual Format (Fastest)
Use this method if you still need the date for calculations but want the spreadsheet to only display the time.
- Select the cells or column containing the date and time stamps.
- Go to the Home tab on the top ribbon.
- In the Number group, click the dropdown menu (which usually says "General" or "Custom").
- Select Time from the list.
- If you want a specific format (like 24-hour time or seconds), click More Number Formats... at the bottom of that dropdown, select Time in the Category list, and pick your preferred style.
Method 2: Using a Formula to Strip the Date (Permanent)
Use this method if you need to extract the time into a new column and completely discard the date information.
- Click in an empty cell next to your timestamp (e.g., if your data is in cell A2, click in B2).
- Type the following formula:
=MOD(A2,1) - Press Enter.
- The result will likely appear as a decimal (e.g., 0.75). To fix this, select the cell and change the format to Time using the Home tab dropdown as described in Method 1.
- Hover over the bottom-right corner of the cell (the fill handle) and double-click or drag it down to apply the formula to the rest of the column.
- (Optional) To remove the dependency on the original column, copy the new time column, right-click, and select Paste Values. You can then delete the original date/time column.
Method 3: Using Flash Fill (No Formulas)
Use this method for a quick, one-time extraction without using math or formatting rules.
- Insert a new empty column next to your timestamps.
- In the first cell of the new column, manually type the time exactly as it appears in the first timestamp cell (e.g., if the cell says "2023-10-01 14:30", type "14:30").
- In the second cell, start typing the time from the second timestamp.
- Excel should show a light-grey "ghost" list of suggested times for the rest of the column.
- Press Enter to accept the suggestions and fill the column.
- If the ghost list doesn't appear, select the first cell you typed and press Ctrl + E on your keyboard.
Common Mistakes
- Confusing Formatting with Data Removal: Changing the cell format to "Time" hides the date, but the date is still there. If you sort the data or use it in a formula, Excel still considers the date part of the value.
- Applying Time Format to Decimals: When using the
MODformula, the result looks like a random number (e.g., 0.5416). Many users think the formula failed, but it is actually working; you simply need to change the cell format to "Time" to see it correctly. - Using Text-to-Columns Incorrectly: Some users try to split the cell by a space. While this works, it converts the time into a "Text" string, meaning you can no longer use it for time-based math (like calculating the difference between two times).
Tips
- Keyboard Shortcut: To quickly apply a basic time format to a selected cell, press Ctrl + Shift + @ (on most English keyboards).
- Consistency: If you are working with a large dataset, always use the
MODformula. Flash Fill is convenient but can occasionally make mistakes if your timestamps have inconsistent spacing or formatting. - Custom Formatting: If you need a specific look (like "14:30 hrs"), go to More Number Formats... > Custom and type
hh:mm "hrs"in the Type box.
Troubleshooting
The formula returns #VALUE!
This happens if your "date and time" is actually stored as text rather than a real Excel date value. To fix this, select the column, go to the Data tab, select Text to Columns, and simply click Finish. This often forces Excel to recognize the text as actual dates.
The time is off by several hours
Check if your data includes Time Zone offsets (e.g., UTC+5). Excel does not automatically handle time zones. You will need to add or subtract the hour difference manually using a formula like =MOD(A2,1) + (5/24) to add 5 hours.
Flash Fill didn't suggest anything
Flash Fill requires a pattern. If your timestamps vary wildly in format (some with seconds, some without), Excel may get confused. Try typing the first three examples manually before pressing Ctrl + E.
Frequently Asked Questions
Can I remove the date without adding a new column?
Not if you want to permanently delete the date data. You can change the visual format of the existing cells to "Time," but the date remains hidden in the background. To truly remove it, you must use a formula in a new column and then paste the values back over the original.
What does the MOD(A1,1) formula actually do?
In Excel, 1 equals one full day. The MOD function returns the remainder after division. By dividing the date/time value by 1, the whole number (the date) is removed, leaving only the remainder (the decimal), which represents the time.
Why does my time look like 0.5 when I use a formula?
This is the raw numeric value of the time. 0.5 represents exactly half a day, or 12:00 PM. Change the cell format to "Time" via the Home tab to see it in a readable clock format.
Will this work for timestamps imported from a CSV?
Yes, but CSV imports often bring dates in as text. If the formatting or formulas don't work, use the Text to Columns tool on the Data tab to convert the text strings into official Excel date/time values first.
Is there a way to do this for an entire sheet at once?
If you only need to change the look, click the triangle in the top-left corner of the spreadsheet to select all cells, then change the Number format to "Time." If you need to strip the data, you must apply a formula to each specific column containing timestamps.