I have a date of 4/20/2017 in a cell. Its cell format is Date --> 4/20/2017. When I change the cells format to Text or General the date will change to 42845. How can I keep a value 4/20/2017 when changing the format to Text or General?
I have a date of 4/20/2017 in a cell. Its cell format is Date --> 4/20/2017. When I change the cells format to Text or General the date will change to 42845. How can I keep a value 4/20/2017 when changing the format to Text or General?
If you want to keep the date value to use in calculations you can't.
If you don't need to use it in calculations you could use the TEXT function to convert it to a string.
If posting code please use code tags, see here.
Excel is recognising the value as a number representing a date. If you edit the cell and put an apostrophe (single quote) as the first character it will be treated as Text.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
If the date is in A2 put in B2: =TEXT(A2,"mm/dd/yyyy") and drag down. Then you can use any cell format and it will always stay the same.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks