When working with date-specific information, there might be instances where you need to find the day of the week corresponding to a date. For example, instead of the date, you may want to know whether it’s a Monday or a Tuesday or any other day. This could be useful when working with to-do lists, daily/weekly summary reports, etc. In this tutorial,
we will see three different ways of converting dates to the corresponding day of the week in Excel. For all the three methods in this tutorial, we will be using the following sample dataset. We will convert all the dates in the above sample dataset into corresponding days of the week.
Method 1: Converting Date to Day of Week in Excel using the TEXT FunctionThe TEXT function is a great function to convert dates to different text formats. It takes a date serial number or date and lets you extract parts of the date to fit your required format. Here’s the syntax for the TEXT function: = TEXT (date, date_format_code) In this function,
The TEXT function applies the date_format_code that you specified on the provided date and returns a text string with that format. For example, if you have the date “2/10/2018” in cell A2, then =TEXT(A2,”dddd”) will return “Saturday”. Here, “dddd” is the date_format code to display the day of the week corresponding to date in full words. Here are some basic building blocks for the format codes that you can use: Format Codes for Day of the Week or Month:You can use the following basic format codes to represent day values:
So,
Let us see how we can apply the TEXT function to our sample dataset to convert all the dates to days of the week. We will first see how to convert the dates in column A to the format shown in column B in the image below: Below are the steps to convert date to weekday name using the TEXT function:
You should see all the dates converted to the short form of their corresponding days of the week: The result you get in column B will differ according to the format code you used in step 2. Here are some format codes along with the type of result you will get when applied to cell A2:
Note: Using this formula, your converted date is in text format, so you will see the results aligned to the left side of the cells. Method 2: Converting Date to Day of Week in Excel using the Format Cells FeatureThe Format Cells feature provides a great way to directly convert your dates to days of the week while replacing the existing dates. As such you don’t need to have a separate column to type the formula. You can use the Format Cells dialog box to convert your dates to days of the week as follows:
All your selected cells should now appear as weekday names. Note: By using Format Cells, you have just changed the format in which the dates are displayed in the cells. The actual dates are underlying the cells and can be seen in the formula bar when a cell is selected. Method 3: Converting Date to Day of Week in Excel using a FormulaIf you’d rather use your own representation for the days of the week, you can use a formula based on both the WEEKDAY and CHOOSE functions. First, let us understand these two functions individually. The WEEKDAY FunctionThe WEEKDAY function converts a date to a number between 1 and 7, one for each day of the week. It chooses the sequencing of these numbers based on the day we want the week to begin from. This is helpful because in some countries, the week starts from Sunday, while in others, especially Middle Eastern countries, the week starts from Saturday. The syntax for the WEEKDAY function is: WEEKDAY(date, [type]) Here,
In our example, WEEKDAY(A2, 1) will return 7, corresponding to a Saturday. The CHOOSE FunctionThe CHOOSE function lets you specify a particular outcome depending on a value. For example, you can choose to display the word “red” if a value is 1, “blue” if it is 2, “green” if it is 3, and so on. In this way it’s a great alternative to using a bunch of nested IF functions. The syntax for the CHOOSE function is: =CHOOSE (index, value1, [value2], …) Here,
etc. The function returns value1 if index is 1, value2 if index is 2, etc. So the function: =CHOOSE(3, “sun”,”mon”,”tue”,”wed”,”thu”,”fri”, ”sat”) will return “tue”, because it’s the third value in the list. Putting the Formula TogetherLet us put the two functions CHOOSE and WEEKDAY together to convert date to day of the week. Here are the steps to follow:
Here’s what you should get as the result: How did this Formula Work?To understand how this formula worked, we need to break it down:
Thus we get the day corresponding to the date in A2 (in our example) to be “sat”. Note: The above formula will give your converted date in text format, so you will see the results aligned to the left side of the cells. You could also have any other format for the days in the list, for example, if you wanted to display just the first two letters for the days, you could have written the formula in step 2 as: =CHOOSE(WEEKDAY(A2),"Su","Mo","Tu","We","Th","Fr","Sa") So you could get an output as: If you wanted to make a to-do list, you could even have an activity for each day of the week. For example, you could use the formula: =CHOOSE(WEEKDAY(A2),"cycling","rollerblading","swimming","skiing","art","crafts","free time") So you could get an output as: In this tutorial, we saw three ways to convert a date to the day of the week. The first method involves a function (TEXT), the second method involves a commonly used Excel dialog box (Format Cells) and the third method involves an Excel formula (with WEEKDAY and CHOOSE functions). We hope you found this tutorial helpful and easy to apply to your data. Other Excel tutorials you may find useful:
What is the formula for weeks in Excel?The WEEKNUM Function[1] is an Excel DATE and TIME Function. It will return the week number of a specific date. The function will return an integer that represents a week number from 1 to 52 weeks of the year.
How do I convert a date to a week and year in Excel?How to get the week number from a date. To get the ISO week number (1-53) for a date in cell A1 , use =ISOWEEKNUM( A1 ) . The is supported in Excel 2022 and later, and Excel 2011 for Mac and later. To get the corresponding year, use =YEAR( A1 - WEEKDAY( A1 , 2) + 4) .
|