![]() ![]() This uses the Date.DayOfWeekName power query function.Ī similar command can be found in the Transform tab. This will add a new column containing the weekday name and we can see the M code that’s generated in the power query formula bar. = Table.AddColumn( #"Changed Type", "Day Name", each Date.DayOfWeekName( ), type text ) With the date column selected, go to the Add Column tab.Click on the icon in the left of the column heading and select Date from the options. We need to make sure the column is converted to the date data type.We can now transform our dates into the name of the weekday. This will open up the power query editor. Press the From Table/Range command in the Get & Transform Data section. ![]() Select a cell inside the Excel table containing the dates.We first need to import our data into the power query editor. It makes any data transformation easy and it can get the name of the weekday too. Power Query (also known as Get & Transform) is a powerful data wrangling tool available in Excel 2016 onward. The WEEKDAY function returns a number from 1 to 7 and we can then use the SWITCH function to assign a weekday name to each of these numbers. On its own, the WEEKDAY function can only return a number representing the weekday, but we can combine it with the SWITCH function to get the weekday name. Combining SWITCH with WEEKDAY to Return the Weekday Name In this case returns a 6 because it’s a Friday. ![]() The second argument value of 1 will return a 1 for Sunday through to 7 for a Saturday. The above formula will convert our date value in cell B2 into the corresponding weekday number.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |