Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Epoch Conversion in Excel: Step-by-Step Guide

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To convert a Unix epoch timestamp to a readable date in Excel, divide the number by 86,400 (the number of seconds in a day) and add the epoch start date of 1 January 1970, then format the result as a date and time. The formula looks like this: =(A1/86400)+DATE(1970,1,1). If your timestamp is in milliseconds, divide by 86,400,000 instead. That single formula handles the vast majority of cases; the rest of this guide covers the variations, the time zone corrections, and the traps that make the result look wrong.

What You'll Need

  • Microsoft Excel (desktop, Microsoft 365, or Excel for the web) or another spreadsheet that supports the DATE function — Google Sheets and LibreOffice Calc use the same logic.
  • A column of epoch values stored as numbers, not as text. If the cells are left-aligned by default, they are probably text and need converting first.
  • A rough idea of whether your values are in seconds, milliseconds, or microseconds, and whether they are UTC or local time. This matters more than anything else in the process.
  • Optionally, a known reference value to sanity-check against — for example, the timestamp 0 should resolve to 1 January 1970, 00:00:00 UTC.

Step-by-Step

  1. Identify the unit. Look at the number of digits. A 10-digit number is almost certainly seconds (good until roughly the year 2286). A 13-digit number is milliseconds. A 16-digit number is microseconds. Getting this wrong shifts your dates by decades or puts them in 1970, so check before writing any formula.
  2. Confirm the cells are numeric. Select the column and check the alignment and the number format. If Excel treats the values as text, the arithmetic will fail with a #VALUE! error. To fix text values, use Data > Text to Columns, click Finish on the default settings, or multiply the range by 1 in a helper column and paste the results back as values.
  3. Write the seconds formula. In an empty column next to your data, enter =(A2/86400)+DATE(1970,1,1), assuming your first timestamp is in A2. Press Enter. The result will appear as a five-digit serial number — that is normal, because Excel stores dates as numbers counting from 1 January 1900.
  4. Adjust for milliseconds. If your values are 13 digits, use =(A2/86400000)+DATE(1970,1,1). For microseconds, divide by 86,400,000,000.
  5. Format the result as a date. With the formula cell selected, press Ctrl+1 (Cmd+1 on Mac) to open Format Cells, choose Date or Custom, and pick a format such as yyyy-mm-dd hh:mm:ss. Without this step the cell shows a meaningless integer.
  6. Apply the formula down the column. Drag the fill handle or double-click it to copy the formula to the bottom of your data. Alternatively, convert the source range to an Excel Table (Ctrl+T) and the formula will fill automatically as rows are added.
  7. Correct for your time zone. The formula returns UTC. To convert to a fixed local offset, add or subtract hours as fractions of a day. For example, for UTC+2 add 2/24; for UTC-5 subtract 5/24. The full formula becomes =(A2/86400)+DATE(1970,1,1)+2/24. Note that this is a fixed offset and will not follow daylight saving changes.
  8. Handle daylight saving properly if it matters. Excel has no built-in time zone database. If you need accurate local times across DST boundaries, either convert the epoch to UTC in Excel and let a system that knows the time zone display it, or maintain a small lookup table of your region's DST start and end dates and add an hour conditionally. For most reporting purposes a fixed offset is enough; for scheduling or logging across regions it is not.
  9. Verify against a known value. Test with a timestamp you can check independently. If 0 returns 1970-01-01 00:00:00 and a recent timestamp lands on today's date, your formula and unit are correct.
  10. Convert the formulas to static values if needed. If you are going to delete the source column or share the file with someone whose Excel might recalculate differently, copy the converted column and use Paste Special > Values to replace formulas with fixed dates.

Common Mistakes

Using the wrong divisor. Dividing a millisecond timestamp by 86,400 produces a date tens of thousands of years in the future. Always count the digits first.

Forgetting the DATE(1970,1,1) anchor. Dividing alone gives you the number of days since 1900, not since 1970, so every result is offset by exactly 25,569 days.

Leaving the cell as General format. The formula is correct but the display is a raw serial number, which looks like a failure when it is not.

Assuming the timestamp is local time. Unix epoch is defined as UTC. If a system logged local time as if it were epoch, your converted value will be off by your offset, and no formula can detect that — you have to know the source.

Text-formatted numbers. Values imported from CSV or copied from a web page often arrive as text. The formula returns #VALUE! until they are converted to numbers.

Negative timestamps. Dates before 1970 produce negative serial numbers, and Excel's 1900 date system cannot display dates before 1 January 1900. Very old timestamps need a different approach, such as calculating the difference in days and presenting it as text.

Tips

Keep the raw epoch column intact and put conversions in a separate column. You will want the original numbers for sorting, filtering, and re-checking.

Name your conversion column clearly, for example "Created (local)", so nobody later mistakes a converted date for the source value.

If you convert the same data repeatedly, save a template workbook with the formula and formatting already in place. It takes seconds to reuse and avoids re-deriving the divisor each time.

Use a custom number format like yyyy-mm-dd hh:mm:ss rather than a locale-dependent short date. It sorts correctly as text and is unambiguous across regions where day and month order differ.

For dashboards, keep the UTC conversion in a hidden helper column and display only the adjusted local time. That way you can change the offset in one cell rather than editing every formula.

Troubleshooting

The result is a number like 45000. The formula worked; the cell is just formatted as General. Apply a date format with Ctrl+1.

You see #VALUE!. The source cell contains text, a stray space, or a non-breaking character. Clean it with TRIM or re-import the column as numbers.

Every date is in 1970. The divisor is far too large for the unit — you are probably dividing a seconds value by 86,400,000. Check the digit count.

Dates are decades off. Either the anchor date is missing or the unit is wrong. Compare a converted value against a reference timestamp you trust.

Times are consistently a few hours out. That is the UTC-to-local offset. Add or subtract the correct fraction of a day.

Times are an hour out only for part of the year. You have hit daylight saving. Use a fixed offset only if the data does not cross a DST boundary, or apply the conditional hour adjustment described above.

The formula copies down but shows the same value everywhere. The references are absolute (with $ signs) when they should be relative, or calculation is set to Manual. Check Formulas > Calculation Options and set it to Automatic.

Frequently Asked Questions

Why do I divide by 86,400?

Excel stores one day as the number 1, and there are 86,400 seconds in a day. Dividing seconds by 86,400 converts them into Excel's day units, which the DATE anchor then shifts to the correct calendar date.

How do I tell seconds from milliseconds?

Count the digits. Ten digits is seconds, thirteen is milliseconds, sixteen is microseconds. A seconds value for a date in the 2020s is around 1.7 billion, which is ten digits.

Can Excel convert epoch to local time automatically?

Not with a built-in function. Excel has no time zone database, so you apply a fixed offset yourself. Accurate DST handling requires a lookup table of transition dates or conversion outside Excel.

Does this work in Google Sheets?

Yes. The same formula works, though Sheets may auto-format the result as a date. If it does not, use Format > Number > Date time.

What about epoch values before 1970?

They produce negative serial numbers, which Excel's default date system cannot display as dates. You can still compute the difference in days and present it as text, but a native date display is not possible.

Why does my converted date not match another tool's output?

Almost always a time zone difference. Many online converters default to your browser's local time while Excel returns UTC. Compare the raw UTC values before assuming the formula is wrong.