Another Question about Dates - Dire Situation

eSourceCity

New Member
Joined
Apr 28, 2014
Messages
5
How can I show a date in the format YYYY-MM-DD referencing cells from a different sheet when the referenced cells are written as text using the following two formats:

1) 2014-04-23T16:38:06.000Z (currently formatted as "general")
2) 4/21/2014 9:09:52 PM (currently formatted as custom - m/d/yyyy h:mm



AB
1Raw DateFormatted Date
2
4/21/2014 21:31

<tbody>
</tbody>
32014-04-22T15:32:38.000Z
44/21/2014 22:24
52014-04-22T18:32:05.000Z
6
2014-04-22T20:00:25.000Z

<tbody>
</tbody>
74/21/2014 23:39

<tbody>
</tbody>

For example, the above table, what would be the single formula that would return the requested format YYYY-MM-DD for each row.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
PUEDES ProBar esta, espero te SIRVA!
= TEXTO (SUSTITUIR (SUSTITUIR (B2, "Z", " ", 1), "T", " ", 1), " AAAA-MM-DD ")

me PARECE Que en tu Idioma es algo asi!

= TEXT (replace (replace (B2; "Z", " ", 1); "T", " ", 1), "aaaa-mm-dd")

la idea es sustituir la letra "T" y "Z", POR Espacios y USAR la fórmula de texto pára dar Formato
 
Last edited:
Upvote 0
PUEDES ProBar esta, espero te SIRVA!
= TEXTO (SUSTITUIR (SUSTITUIR (B2, "Z", " ", 1), "T", " ", 1), " AAAA-MM-DD ")

me PARECE Que en tu Idioma es algo asi!

= TEXT (replace (replace (B2; "Z", " ", 1); "T", " ", 1), "aaaa-mm-dd")

la idea es sustituir la letra "T" y "Z", POR Espacios y USAR la fórmula de texto pára dar Formato

Thanks, but the formula needs to work with both existing formats shown in the referenced cells. Perhaps there is a hardcode for this?
 
Upvote 0
Thanks, but the formula needs to work with both existing formats shown in the referenced cells. Perhaps there is a hardcode for this?

y esta?
4/21/2014 21:31 2014/04/21
2014-04-22T15:32:38.000Z 2014/04/22
4/21/2014 22:24 2014/04/21
2014-04-22T18:32:05.000Z 2014/04/22
2014-04-22T20:00:25.000Z 2014/04/22
4/21/2014 23:39 2014/04/21

use la siguiente formula:

=SI(ESERROR(ENCONTRAR("/",A2)),TEXTO(SUSTITUIR(SUSTITUIR(A2,"Z"," ",1),"T"," ",1),"aaa/mm/dd"),TEXTO(EXTRAE(A2,ENCONTRAR("/",A2,4)+1,4)&"/"&EXTRAE(A2,1,ENCONTRAR("/",A2,4)-1),"aaa/mm/dd"))

en ingles me parece seria asi:

=IF(ISERROR(FIND("/",a2)),TEXT(SUBSTITUTE(SUBSTITUTE(a2,"Z"," ",1),"T"," ",1),"yyy/mm/dd"),TEXT(MID(a2,FIND("/",a2,4)+1,4)&"/"&MID(a2,1,FIND("/",a2,4)-1),"yyy/mm/dd"))

saludos!!
 
Upvote 0
y esta?
4/21/2014 21:31 2014/04/21
2014-04-22T15:32:38.000Z 2014/04/22
4/21/2014 22:24 2014/04/21
2014-04-22T18:32:05.000Z 2014/04/22
2014-04-22T20:00:25.000Z 2014/04/22
4/21/2014 23:39 2014/04/21

use la siguiente formula:

=SI(ESERROR(ENCONTRAR("/",A2)),TEXTO(SUSTITUIR(SUSTITUIR(A2,"Z"," ",1),"T"," ",1),"aaa/mm/dd"),TEXTO(EXTRAE(A2,ENCONTRAR("/",A2,4)+1,4)&"/"&EXTRAE(A2,1,ENCONTRAR("/",A2,4)-1),"aaa/mm/dd"))

en ingles me parece seria asi:

=IF(ISERROR(FIND("/",a2)),TEXT(SUBSTITUTE(SUBSTITUTE(a2,"Z"," ",1),"T"," ",1),"yyy/mm/dd"),TEXT(MID(a2,FIND("/",a2,4)+1,4)&"/"&MID(a2,1,FIND("/",a2,4)-1),"yyy/mm/dd"))

saludos!!

You Sir, are a genius. Works perfect once I tweak it to work in my specific spreadsheet. Thanks so much!!!
 
Upvote 0
If I understand your request correctly, I think you can use this formula and then format the cell using yyyy-mm-dd...

=INT(LEFT(A2,FIND("T",A2&"T")-1))

That way, your cells would contain real dates that could be used as part of calculations in other formula. However, if you are happy with a straight Text output, then you can use this formula instead...

=TEXT(INT(LEFT(A2,FIND("T",A2&"T")-1)),"yyyy-mm-dd")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

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