Forum Discussion
liz123395
Nov 10, 2023Copper Contributor
Changing date format - August 2023 to 8/1/2023
Hi,
I am wanting to change a date format from a text date such as August 2023 or September 2019 to 8/1/2023 or 9/1/2019. So I am looking to change it to not only a date format but also assume the day of the month to be the 1st.
Does anyone have any ideas on how to go about this?
- =DATEVALUE(A2)
=TEXT(DATEVALUE(A2),"m/d/yyy")
- NikolinoDEGold Contributor
You can convert the text-based month and year format to a date format in Excel by combining the month and year text strings with the day "1".
Here is a simple approach using a formula:
Assuming "August 2023" is in cell A1, you can use the following formula:
=DATEVALUE("1 " & LEFT(A1, FIND(" ", A1) - 1) & " " & MID(A1, FIND(" ", A1) + 1, LEN(A1) - FIND(" ", A1)))
This formula works by extracting the month and year from the text string and using the DATEVALUE function to convert it into a date format with the day set to "1".
Steps:
- Assuming your dates are in column A:
- Enter the formula in an adjacent cell or wherever you want the converted dates to appear.
- Adjust the cell references accordingly.
This will give you a date format like "8/1/2023" based on the month and year mentioned in the text format.
Or you can create a custom date format to transform the text-based month and year into a date format with a fixed day (like the 1st).
Here is how to do it:
- Select the cells containing the text-based dates.
- Go to the "Format Cells" option:
- Right-click and select "Format Cells" or use the shortcut Ctrl + 1.
- Select the "Custom" category.
- Enter the custom date format:
- Use the type d/m/yyyy in the Type box.
This does not actually change the content of the cell, but it displays the text as a date in the desired format.
If your text-based dates are in column A, the custom format should change "August 2023" to "8/1/2023".
This way, you retain the original text content while displaying it in a date-like format. Just remember, while it looks like a date, it's still a text entry.
See the attached file with the examples.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and Like it!
This will help all forum participants.