• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

Convert Excel date to the same number

I have an Excel file with one column of DATE format field. I want to convert this to a number but keep the same data. for example 20110101 should stay as 20100101 (as a NUMBER format) instead of 40179 that Excel converts it to if I do a change format.
1 Solution
If yor cell with date is A1, you can use:
barry houdiniCommented:
This should also do it....


regards, barry
Gašper KamenšekExcel MVPCommented:
The correct way would actually be to press Ctrl+1 ( or right click and choose Format cells) go to custom format, and write yyyymmdd or yyyyddmm which ever you prefer.
With this you achieve precisely what you want. You still have the same data, but in the format you desire.
Best of  luck.
barry houdiniCommented:
.....I think that's exactly what gmollineau is trying to avoid GasperK. If you do that then the format only is changed (not the cell contents) and if you change the format to general you'll see a number like 40179.

My suggestion and the suggestion of als315 both use an extra cell to do the conversion, you can only change the cell content "in situ" if you use VBA.

regards, barry
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now