ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Extract Date from text (https://www.excelbanter.com/excel-worksheet-functions/446282-extract-date-text.html)

sabineb

Extract Date from text
 
Hello
I have a cell that reads:

Week Ending:June 02, 2012

and I need to extract the date a June 02 (format 'mmm d') into another cell.

Can anyone tell me how?

Thanks for the help
Sabine

Spencer101

Quote:

Originally Posted by sabineb (Post 1602537)
Hello
I have a cell that reads:

Week Ending:June 02, 2012

and I need to extract the date a June 02 (format 'mmm d') into another cell.

Can anyone tell me how?

Thanks for the help
Sabine

Hi Sabine,

The formula below will extract the month and day from the text string, however you will not be able to use the result in calculations as it's not a true date format.

Still working on fixing that, but I'm sure someone more clued up on this than I will be along to improve this.

=MID(A1,FIND(":",A1)+1,FIND(",",A1)-FIND(":",A1)-1)

(the above formula presumes your text string is in cell A1, amend as necessary)

Ron Rosenfeld[_2_]

Extract Date from text
 
On Sat, 9 Jun 2012 20:06:36 +0000, sabineb wrote:


Hello
I have a cell that reads:

Week Ending:June 02, 2012

and I need to extract the date a June 02 (format 'mmm d') into another
cell.

Can anyone tell me how?

Thanks for the help
Sabine


To extract that number as a"real" date, where you can format the cell however you want:

=--TRIM(MID(A1,FIND(":",A1)+1,20))

To do the same, but return a text string (not a "real" date) of mmm d format, use:

=TEXT(--TRIM(MID(A1,FIND(":",A1)+1,20)),"mmm d")


sabineb

To extract that number as a"real" date, where you can format the cell however you want:

=--TRIM(MID(A1,FIND(":",A1)+1,20))






Thanks so much this one did the trick

Sabine


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com