Power Query - changing date format

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I have a workbook which has a date column but formatted as a text because they are aligned to the left and also istext() is true. So I tried to use Power Query to convert them to date in date format not text. Please see the link for the file. Power Query fist showed me the date as picture1 (different format from Excel and it is aligned to the right) and then when I tried to click on the header of the column and select Date, it gave me "error", replaced date with error keyword. Then I cancelled the transform but to my surprised the date converted to what was in Excel format (exactly like excel and aligned to the left) - see picture two please, my questions

1) Why PowerQ behaved like that?
2) How you would covert date like that using PQ so the column will be showing date only not time. I was thinking to split from the right but I am thinking it must be better way?

Thank you very much

Book1.xlsx
ABCD
1FirstName LastNameDeptStarting Date
2Skylar WiddowsInventoryTuesday, April 21, 2009 4:19 AMTRUE
3Georgia SimpsonProperty departmentTuesday, October 6, 1992 11:39 AM
4Marvin SaltInternational OperationsSunday, August 5, 2001 8:58 PM
5Owen MackenzieAdvertisement departmentSunday, January 12, 2014 5:39 PM
6Eduardo BloomNon-Store OperationsSunday, May 31, 2020 6:01 AM
7Stacy VealeAdvertisement departmentSaturday, March 20, 2021 7:25 PM
8Cedrick UmneyInventoryMonday, October 23, 2017 4:54 PM
9Esmeralda RoseLegal and public relation departmentThursday, September 28, 2000 9:42 PM
10Emmanuelle WrightLogisticsMonday, July 14, 2008 5:49 PM
11Wade HallAdvertisement departmentWednesday, August 12, 1998 8:17 AM
Sheet1
Cell Formulas
RangeFormula
D2D2=ISTEXT(C2)


pq1.jpg
pq2.jpg

 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,214,412
Messages
6,119,369
Members
448,888
Latest member
Arle8907

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