ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to retrieve certain char within a string? (https://www.excelbanter.com/excel-discussion-misc-queries/148760-how-retrieve-certain-char-within-string.html)

Eric

How to retrieve certain char within a string?
 
In cell A1, there is a string "Updated: 2007-06-29 15:45(3)"
If the string in cell A1 contains the key word "Updated", then
retrieve the date "2007-06-29" in cell B1.
Does anyone have any suggestions?
Thank in advance for any suggestions
Eric

T. Valko

How to retrieve certain char within a string?
 
Try this:

Assuming the date is *always* in this format: yyyy-mm-dd and that "Updated"
(if present) is *always* at the beginning of the string:

=IF(LEFT(A1,7)="Updated",DATEVALUE(MID(A1,10,10)), "")

Format as DATE

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
In cell A1, there is a string "Updated: 2007-06-29 15:45(3)"
If the string in cell A1 contains the key word "Updated", then
retrieve the date "2007-06-29" in cell B1.
Does anyone have any suggestions?
Thank in advance for any suggestions
Eric





All times are GMT +1. The time now is 06:59 PM.

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