The text value in P12 = Thu 19 Oct 2023 - Fri 27 Oct 2023 The formula in Q12 is…
- User
The text value in P12 = Thu 19 Oct 2023 - Fri 27 Oct 2023 The formula in Q12 is =LEFT(P12, FIND(" -", P12) - 1) and the value dispalyed is 'Thu 19 Oct 2003' In R12, how can I convert the Value in Q2 to Date Format dd mm yyyy
- Assistant
To convert the value in Q12 to the date format dd mm yyyy in R12, you can use the following formula:
=DATEVALUE(MID(Q12,5,2)&" "&MID(Q12,9,3)&" "&MID(Q12,14,4))
Explanation:
- MID(Q12,5,2) extracts the day portion from the text value in Q12.
- MID(Q12,9,3) extracts the month portion from the text value in Q12.
- MID(Q12,14,4) extracts the year portion from the text value in Q12.
- The DATEVALUE function converts the extracted day, month, and year into a proper date format.
Make sure the cell format in R12 is set to Date format (dd/mm/yyyy) to display the date correctly.
- User
I get a #VALUE! error
- Assistant
Apologies for the confusion. In your case, the dates in Q12 are not recognized as valid dates by Excel, causing the #VALUE! error.
To resolve this, you can use the following formula in R12:
=DATEVALUE(MID(Q12,5,2)&"-"&MID(Q12,9,3)&"-"&MID(Q12,14,4))This formula modifies the text values in Q12 to a format that Excel recognizes as a date. It does this by replacing the spaces in the text value with hyphens before using the DATEVALUE function to convert it into a proper date format.
Again, ensure that the cell format in R12 is set to Date format (dd/mm/yyyy) to display the converted dates correctly.
- User
still get a #VALUE! error
- Assistant
Apologies once again for the confusion. The #VALUE! error can occur if the text value in Q12 cannot be recognized as a valid date format by Excel.
To overcome this, you can use the following formula in R12, assuming the original text value is always in the format "Thu DD MMM YYYY":
=DATEVALUE(MID(Q12,5,2)&"-"&MID(Q12,9,3)&"-"&MID(Q12,13,4))This formula extracts the day, month, and year portions from the text value in Q12 and rearranges them in a format recognized by Excel as a date.
If you are still encountering the #VALUE! error, make sure that the text value in Q12 is in the correct format and does not contain any additional characters or spaces.