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...
Abiola1
Jan 07, 2020MVP
Hello,
To split the date:
1. Select all the dates
2. Click on Text to Column in Data tab
3. Select Delimited and click Next
4. In Step 2, check Other. In the Order box, put in /
5. In Step 3, choose destination cell
6 click Finish
Thats all
To split the date:
1. Select all the dates
2. Click on Text to Column in Data tab
3. Select Delimited and click Next
4. In Step 2, check Other. In the Order box, put in /
5. In Step 3, choose destination cell
6 click Finish
Thats all
- Riny_van_EekelenJan 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.
- Abiola1Jan 07, 2020MVPIn the example of the attached workbook:
1. Select cell A2
2. Click on Text to Column in Data tab
3. Select Delimited and click Next
4. In Step 2, check Other. In the Order box, put in /
5. In Step 3, choose destination cell
6 click Finish
Thats all- simona6Jan 07, 2020Copper ContributorI did. But the result was a number that was none of those in the original cell.