Date Format

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,062
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
I have the date format in column like mention below, need to change it to the function is not working to give the required out put.
I don't want to change the cell format, as all. Any idea.

INCIDENT_CREATION_DATE​
Output
3/24/2020 0:00​
=TEXT(H2,"dd-mm-yyyy"))
3/24/2020 0:00​
=TEXT(H3,"dd-mm-yyyy"))
3/24/2020 0:00​
=TEXT(H2,"dd-mm-yyyy"))
3/24/2020 0:00​
=TEXT(H2,"dd-mm-yyyy"))
3/24/2020 0:00​
=TEXT(H2,"dd-mm-yyyy"))
3/24/2020 0:00​
=TEXT(H2,"dd-mm-yyyy"))
3/24/2020 0:01​
=TEXT(H2,"dd-mm-yyyy"))
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
the double ) on the end is many times, changing it, also you have H2
 
Upvote 0
It is still not giving me required out put
=TEXT(H2,"dd-mm-yyyy")
 
Upvote 0
In a vacant cell put this formula and tell us the result

=ISNUMBER(H2)
 
Upvote 0
I have tried functions
Datevalue but result is as "#VALUE!"
Date(year,month,day) but result is as "#VALUE!"

no luck
 
Upvote 0
=TEXT(--H2,"dd-mm-yyyy") before the H2
 
Upvote 0
Hi,
Suppose your data is in column A, enter =LEFT(A2,9) in column B.
Then apply =TEXT(C2,"dd-mm-yyyy") in column C
 
Upvote 0
How about one of the below?

Book1
ABC
1INCIDENT_CREATION_DATEOutput1Output2
23/24/2020 0:0024/03/202024/03/2020
33/24/2020 0:0024/03/202024/03/2020
43/24/2020 0:0024/03/202024/03/2020
53/24/2020 0:0024/03/202024/03/2020
63/24/2020 0:0024/03/202024/03/2020
712/24/2020 0:0024/12/202024/12/2020
83/24/2020 0:0124/03/202024/03/2020
93/04/2020 0:0104/03/202004/03/2020
Sheet1
Cell Formulas
RangeFormula
B2:B9B2=DATE(RIGHT(TRIM(LEFT(A2,10)),4),LEFT(TRIM(LEFT(A2,10)),FIND("/",TRIM(LEFT(A2,10)))-1),MID(TRIM(LEFT(A2,10)),FIND("/",TRIM(LEFT(A2,10)))+1,2))
C2:C9C2=IFERROR(IF(ISNUMBER(TRIM(LEFT(A2,10))),VALUE(TEXT(TRIM(LEFT(A2,10)),"mm/dd/yyyy")),DATE(RIGHT(TRIM(LEFT(A2,10)),4),LEFT(TRIM(LEFT(A2,10)),FIND("/",TRIM(LEFT(A2,10)))-1),MID(TRIM(LEFT(A2,10)),FIND("/",TRIM(LEFT(A2,10)))+1,2))),DATE(RIGHT(TRIM(LEFT(A2,10)),4),LEFT(TRIM(LEFT(A2,10)),FIND("/",TRIM(LEFT(A2,10)))-1),MID(TRIM(LEFT(A2,10)),FIND("/",TRIM(LEFT(A2,10)))+1,1)))
 
Last edited:
Upvote 0
Perhaps local date settings will make a difference or I have not interpreted correctly, but these are my observations.
Post 5 indicates original data is Text.
Post 1 attempted formulas indicate a Text result is required
Post 1 also indicates original text dates are in mdy order but result is required in dmy order.

Based on the above, testing of the various suggestions give for me (with my suggestion in column N) ..
(I didn't bother with cell-formatting columns L:M since I think a text answer is wanted and an error occurs for row 3 anyway.)

20 03 29.xlsm
HIJKLMN
1Post 7Post 8Post 8Post 9Post 9Post 10
23/24/2020 0:00#VALUE!3/24/20203/24/202024/03/20204391424-03-2020
33/4/2020 0:0003-04-20203/4/2020 03-04-2020#VALUE!#VALUE!04-03-2020
411/14/2020 0:00#VALUE!11/14/20211/14/20214/11/20204414914-11-2020
Extract & Format Date
Cell Formulas
RangeFormula
I2:I4I2=TEXT(--H2,"dd-mm-yyyy")
J2:J4J2=LEFT(H2,9)
K2:K4K2=TEXT(J2,"dd-mm-yyyy")
L2:L4L2=DATE(RIGHT(TRIM(LEFT(H2,10)),4),LEFT(TRIM(LEFT(H2,10)),FIND("/",TRIM(LEFT(H2,10)))-1),MID(TRIM(LEFT(H2,10)),FIND("/",TRIM(LEFT(H2,10)))+1,2))
M2:M4M2=IFERROR(IF(ISNUMBER(TRIM(LEFT(H2,10))),VALUE(TEXT(TRIM(LEFT(H2,10)),"mm/dd/yyyy")),DATE(RIGHT(TRIM(LEFT(H2,10)),4),LEFT(TRIM(LEFT(H2,10)),FIND("/",TRIM(LEFT(H2,10)))-1),MID(TRIM(LEFT(H2,10)),FIND("/",TRIM(LEFT(H2,10)))+1,2))),DATE(RIGHT(TRIM(LEFT(H2,10)),4),LEFT(TRIM(LEFT(H2,10)),FIND("/",TRIM(LEFT(H2,10)))-1),MID(TRIM(LEFT(H2,10)),FIND("/",TRIM(LEFT(H2,10)))+1,1)))
N2:N4N2=TEXT(REPLACE(SUBSTITUTE(LEFT(H2,FIND(" ",H2)),"/",TEXT(LEFT(H2,FIND("/",H2)-1),"00"),2),1,FIND("/",H2),0),"00-00-0000")
 
Upvote 0

Forum statistics

Threads
1,215,762
Messages
6,126,736
Members
449,334
Latest member
moses007

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top