How to change the format of a field in an Excel TABLE?

Rhino_Dance

Board Regular
Joined
Jul 23, 2008
Messages
74
I have data in an Excel 'table' which was returned from MS QUERY. (I'm using the word 'Table' formally here). One field has entries that look like dates as in '2012-04-01' but the field is a text field and not a date field, and I need to change it to a date field to make it useful to me. The way I can tell it's not a date field is that I get a 'TRUE' to an ISTEXT function on it, as well as the fact that the results I get when I run an IF statement against the field confirm that none of the dates are passing tests that they should.

My Question: How can I change this field to a date field? I've tried highlighting the whole column and using the 'Format Cells' command to change it to a date format but it still remains a text field. Also, I don't want to add any companion fields as I 'm trying to automate a complex spreadsheet and write formulas directly against the query result. Thanks.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Thanks Andrew. It's good to know that's an option. In the end, the source of the problem turns out to be that the underlying Sql Server db had the field stored as text and not as a date (even though it looks exactly like a date). So I modified the SQL code in the MS Query to convert the field to a date using CONVERT(datetime, Start_Date, 101) which turns a text entry like '2012-04-01' into an actual date field like '4/1/12'.
 
Upvote 0

Forum statistics

Threads
1,223,924
Messages
6,175,415
Members
452,640
Latest member
steveridge

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