How to convert dates

lcohenvb

New Member
Joined
Oct 27, 2002
Messages
44
When I do a query from the database, the date comes back as a text value yyyymmdd. What is the best way to convert it to a date value so that I can use it in a formula. Obviously just changing the format to date does not work. I have also separated the date into three columns with column 1 being yyyy, column 2 as mm and column 3 as dd but when I try to concatenate it I still cannot get it into a date format. Any help is appreciated. Thanks!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
highlight the column, go to data | text to columns, click next twice, then select 'Date' as the column data format & select YMD from the drop-down. ckick finish

paddy
 

lcohenvb

New Member
Joined
Oct 27, 2002
Messages
44
Paddy, it worked like a charm. I swear I tried that before and it didn't! Thanks so much, I've been working on this for an hour!

LC
 

Forum statistics

Threads
1,144,260
Messages
5,723,304
Members
422,492
Latest member
RobF2112

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
Top