Forum Discussion
simona6
Jan 07, 2020Copper Contributor
How do I split up a cell containing a date?
I have an Excel document with over 4,000 rows in it, and many in one column are dates. I need to split it so I can run a PHP import, so it matches with our database. If I do =left(W6,2), I as...
Riny_van_Eekelen
Jan 07, 2020Platinum Contributor
As an alternative:
I opened your workbook and entered =DAY(A2) in B2 and it displayed "13" as expected. Entering LEFT(A2,2), however, results in "28", being the first two digits of the number value for the date 13 April 1977, which is 28228. That's how Excel stores dates.
You may use =MONTH(cell) and =YEAR(cell) to extract the month and the year.