SOLVED

Need help in extracting the latest date from a cell

Copper Contributor

Hello Everyone,

 

Last 7 Days (9/1/22-9/7/22)

Need help in extracting the latest date from the above string in a cell.

2 Replies

@Ansari3108 If you have access to most recent release of Excel formulas then try-

=--TEXTBEFORE(TEXTAFTER(A1,"-",-1),")")

For older excel later than 2013 can try. See the attached file.

=FILTERXML("<t><s>"&SUBSTITUTE(SUBSTITUTE(A1,")",""),"-","</s><s>")&"</s></t>","//s[last()]")

 Harun24HR_0-1662632859150.png

 

best response confirmed by Ansari3108 (Copper Contributor)
Solution

@Ansari3108 

Let's say the text is in cell A1.

Enter the following formula in another cell:

 

=DATEVALUE(MID(A1,FIND("-",A1)+1,LEN(A1)-FIND("-",A1)-1))

 

Format the cell with the formula as a date.

1 best response

Accepted Solutions
best response confirmed by Ansari3108 (Copper Contributor)
Solution

@Ansari3108 

Let's say the text is in cell A1.

Enter the following formula in another cell:

 

=DATEVALUE(MID(A1,FIND("-",A1)+1,LEN(A1)-FIND("-",A1)-1))

 

Format the cell with the formula as a date.

View solution in original post