[SOLVED] How to have "Excel for Mac 2016" Auto-convert entry of yymmdd to yyyy-mm-dd

Status
Not open for further replies.

John Dohe

Honorable
Apr 2, 2017
63
1
10,545
Hi,

I want to type, say, 20201008 or 201008 into a cell and as soon as I press
the enter or tab key have "Excel for mac 2016" immediately convert either
entry to 2020-10-08.

I don't want to have another column set up that uses a formula to convert
20201008 or 201008 to 2020-10-08.

I want Excel to do the conversion in the background, or as a formula for that cell,
but that it works to allow me to type into that cell 20201008 or 201008 and as soon
as I press the enter or tab key the cell displays 2020-10-08.

Anyone got a way to do this?

Thanks!
 
Solution
If you want it to be a "Date", you must enter it in some sort of date format.

Here, the shaded cells are Date format.
E1 entered as 2020-10-11. Excel sees this as a Date, and you can do whatever.
E2 entered as 20201011. Excel sees this as just a string of numbers
E3 entered as 20-10-11. Excel sees this as a String.
MBMdogm.png



Converting from "20201011" to an actual Date would require some bit of macro/VB coding, and lots of error checking.

Entered as 120611. Is that the June 11, 1200, or Jan 11, 1206?

kanewolf

Titan
Moderator
Hi,

I want to type, say, 20201008 or 201008 into a cell and as soon as I press
the enter or tab key have "Excel for mac 2016" immediately convert either
entry to 2020-10-08.

I don't want to have another column set up that uses a formula to convert
20201008 or 201008 to 2020-10-08.

I want Excel to do the conversion in the background, or as a formula for that cell,
but that it works to allow me to type into that cell 20201008 or 201008 and as soon
as I press the enter or tab key the cell displays 2020-10-08.

Anyone got a way to do this?

Thanks!
If you want it to be an Excel date then you will have to have another column. If you just want to format your number with dashes then you can build a custom number format. For example, go into format cells and create a custom format of "####-##-##"
 

John Dohe

Honorable
Apr 2, 2017
63
1
10,545
If you want it to be an Excel date then you will have to have another column. If you just want to format your number with dashes then you can build a custom number format. For example, go into format cells and create a custom format of "####-##-##"

Hi!

That was helpful! It did allow me to enter 20201008 and have it display as 2020-10-08.

However, I do need to have the cell formatted as a date for other calculations.

Any other ideas?

Thanks!
 

John Dohe

Honorable
Apr 2, 2017
63
1
10,545
Well, it is either a Number or a Date.
Not both.

Hi,

Since I need to refer back to that date for other calculations,
I need the cell to be an Excel date format.

What I'm thinking is to create a formula for a cell that will use
the contents of the yyddmm cell, convert yyddmm cell to an Excel
date format, display yyddmm as yy-mm-dd IN the original yyddmm
cell . . . and then I hide the column that does this work.

The goal is to be able to just enter yyddmm into the cell that displays,
press enter or tab, and the hidden column still works to convert yyddmm
to yy-dd-mm -but- as an Excel date. This way I can still refer back to
the yy-dd-mm cell for date calculations.

Will this work?

I'm not a regular Excel user so I appreciate someone who is more
experienced than me to review that idea, test it, and see if it works.

Thanks!
 
Hi,

Since I need to refer back to that date for other calculations,
I need the cell to be an Excel date format.

What I'm thinking is to create a formula for a cell that will use
the contents of the yyddmm cell, convert yyddmm cell to an Excel
date format, display yyddmm as yy-mm-dd IN the original yyddmm
cell . . . and then I hide the column that does this work.

The goal is to be able to just enter yyddmm into the cell that displays,
press enter or tab, and the hidden column still works to convert yyddmm
to yy-dd-mm -but- as an Excel date. This way I can still refer back to
the yy-dd-mm cell for date calculations.

Will this work?

I'm not a regular Excel user so I appreciate someone who is more
experienced than me to review that idea, test it, and see if it works.

Thanks!
That's not how Excel works. The results of your calculations will reside in the cell that does the calculation. If it were possible to do it the way you described it would form an infinite loop.
 

John Dohe

Honorable
Apr 2, 2017
63
1
10,545
Oh yes, that works.

The issue here is taking the String or Number 20201011 and making that a "date".

@USAFRet

Hi!

I'm getting a little confused with all the replies! Having a time keeping track
of who says what, the way this forum presents.

So, can you give me an actual example of what works?

What to put into what cell, how to make it do the conversion of yymmdd
to yyyy-mm-dd, what the formulas are, and if you could include screenshots
I would be very appreciative!

Thanks!
 
@USAFRet

Hi!

I'm getting a little confused with all the replies! Having a time keeping track
of who says what, the way this forum presents.

So, can you give me an actual example of what works?

Thanks!
Simple. Set the cell/s to "date format" with the appropriate display format chosen. Dates will then have to be entered in that format (no getting around it). You can then do date math in any other cell/s (just make sure to set those cells to "date" to get a proper display)

You can also use the date picker for a more point-shoot entry.

 

USAFRet

Titan
Moderator
If you want it to be a "Date", you must enter it in some sort of date format.

Here, the shaded cells are Date format.
E1 entered as 2020-10-11. Excel sees this as a Date, and you can do whatever.
E2 entered as 20201011. Excel sees this as just a string of numbers
E3 entered as 20-10-11. Excel sees this as a String.
MBMdogm.png



Converting from "20201011" to an actual Date would require some bit of macro/VB coding, and lots of error checking.

Entered as 120611. Is that the June 11, 1200, or Jan 11, 1206?
 
Solution

John Dohe

Honorable
Apr 2, 2017
63
1
10,545
If you want it to be a "Date", you must enter it in some sort of date format.

Here, the shaded cells are Date format.
E1 entered as 2020-10-11. Excel sees this as a Date, and you can do whatever.
E2 entered as 20201011. Excel sees this as just a string of numbers
E3 entered as 20-10-11. Excel sees this as a String.
MBMdogm.png



Converting from "20201011" to an actual Date would require some bit of macro/VB coding, and lots of error checking.

Entered as 120611. Is that the June 11, 1200, or Jan 11, 1206?

What if I limit the date entry to yymmdd?

Would that make it better?
 

John Dohe

Honorable
Apr 2, 2017
63
1
10,545
Simple. Set the cell/s to "date format" with the appropriate display format chosen. Dates will then have to be entered in that format (no getting around it). You can then do date math in any other cell/s (just make sure to set those cells to "date" to get a proper display)

You can also use the date picker for a more point-shoot entry.


THAT may be the plan!

Can the dropdown calandar be activated and navigated to the desired date
by using just the cursor keys ?
 
Status
Not open for further replies.