Given the Salesforce standard way of textually representing dates (YYYY-MM-DDTHH:mm:ss.zzzZ
, for example 2018-11-19T16:06:21.000Z), the following Excel formulae will help you parse out components:
Assuming B2 is the cell in which the Salesfore date is entered
- Year:
=LEFT(B2,4)
- Month:
=RIGHT(LEFT(B2,7),2)
- Day:
=RIGHT(LEFT(B2,10),2)
- Hour:
=RIGHT(LEFT(B2,10),2)
- Min:
=RIGHT(LEFT(B2,10),2)
- Sec:
=RIGHT(LEFT(B2,19),2)
- Timezone:
=RIGHT(B2,4)
- Excel-native number that represents the date in Microsoft Excel date-time code:
=DATEVALUE(CONCATENATE(RIGHT(LEFT(B2,7),2),"/",RIGHT(LEFT(B2,10),2),"/",LEFT(B2,4)))