JohnSi
How to find out day from date (33 อ่าน)
24 เม.ย 2568 19:03
Hello, Guest!
Article about how to find out day from date:
Excel WEEKDAY function: get day of week, weekends and workdays. If you are looking for an Excel function to get day of week from date, you've landed on the right page. This tutorial will teach you how to use the WEEKDAY formula in Excel to convert a date to a weekday name, filter, highlight and count weekends or workdays, and more.
There are a variety of functions to work with dates in Excel. The day of week function (WEEKDAY) is particularly useful for planning and scheduling, for example to determine the timeframe of a project and automatically remove weekends from the total. So, let's run through the examples one-at-a-time and see how they can help you cope with various date-related tasks in Excel. WEEKDAY - Excel function for day of week. The Excel WEEKDAY function is used to return the day of the week from a given date. The result is an integer, ranging from 1 (Sunday) to 7 (Saturday) by default. If your business logic requires a different enumeration, you can configure the formula to start counting with any other day of week. The WEEKDAY function is available in all versions of Excel 365 through 2000. The syntax of the WEEKDAY function is as follows: Serial_number (required) - the date that you want to convert to the weekday number. It can be supplied as a serial number representing the date, as a text string in the format that Excel understands, as a reference to the cell containing the date, or by using the DATE function. Return_type (optional) - determines what day of the week to use as the first day. If omitted, defaults to the Sun-Sat week. Here is a list of all supported return_type values: Return_type Number returned 1 or omitted From 1 (Sunday) to 7 (Saturday) 2 From 1 (Monday) to 7 (Sunday) 3 From 0 (Monday) to 6 (Sunday) 11 From 1 (Monday) to 7 (Sunday) 12 From 1 (Tuesday) to 7 (Monday) 13 From 1 (Wednesday) to 7 (Tuesday) 14 From 1 (Thursday) to 7 (Wednesday) 15 From 1 (Friday) to 7 (Thursday) 16 From 1 (Saturday) to 7 (Friday) 17 From 1 (Sunday) to 7 (Saturday) Note. The return_type values 11 through 17 were introduced in Excel 2010 and therefore they cannot be used in earlier versions. Basic WEEKDAY formula in Excel. For starters, let's see how to use the WEEKDAY formula in its simplest form to get the day number from date. For example, to get the weekday from date in C4 with the default Sunday - Saturday week, the formula is: If you have a serial number representing the date (e.g. brought by the DATEVALUE function), you can enter that number directly in the formula: Also, you can type the date as a text string enclosed in quotation marks directly in the formula. Just be sure to use the date format that Excel expects and can interpret: Or, supply the source date in a 100% reliable way using the DATE function: To use the day mapping other than the default Sun-Sat, enter an appropriate number in the second argument. For example, to start counting days from Monday, the formula is: In the image below, all the formulas return the day of the week corresponding to January 1, 2025, which is stored as the number 45658 internally in Excel. Depending on the value set in the second argument, the formulas output different results. At first sight, it may seem that the numbers returned by the WEEKDAY function have very little practical sense. But let's look at it from a different angle and discuss some formulas that solve real-life tasks. How to convert Excel date to weekday name. By design, the Excel WEEKDAY function returns the day of the week as a number. To turn the weekday number into the day name, employ the TEXT function. To get full day names , use the dddd" format code: To return abbreviated day names , the format code is "ddd": For example, to convert the date in A3 to the weekday name, the formula is: Please note that in this formula, you should use WEEKDAY with only one argument, serial_number . Do not include return_type , even if your week starts on a day other than Sunday. Actually, the WEEKDAY function is unnecessary for this formula. The TEXT function alone would work nicely: Though, we often think of WEEKDAY as the day of week function, which might make this formula easier to remember. Another possible solution is using WEEKDAY together with the CHOOSE function. For example, to get an abbreviated weekday name from the date in A3, the formula goes as follows: Here, WEEKDAY returns a serial number from 1 (Sun) to 7 (Sat) and CHOOSE selects the corresponding value from the list. Since the date in A3 (Wednesday) corresponds to 4, CHOOSE outputs "Wed", which is the 4 th value in the list. Though the CHOOSE formula is slightly more cumbersome to configure, it provides more flexibility letting you output the day names in any format you want. In the above example, we show the abbreviated day names. Instead, you can deliver full names, custom abbreviations or even day names in a different language. Excel WEEKDAY formula to find and filter workdays and weekends. When dealing with a long list of dates, you may want to know which ones are working days and which are weekends. To identify weekends and weekdays in Excel, build an IF statement with the nested WEEKDAY function. For example: This formula goes to cell A3 and is copied down across as many cells as needed. In the WEEKDAY formula, you set return_type to 2, which corresponds to the Mon-Sun week where Monday is day 1. So, if the weekday number is less than 6 (Monday through Friday), the formula returns "Workday", otherwise - "Weekend". To filter weekends or workdays , apply Excel filter to your dataset ( Data tab > Filter ) and select either "Weekend" or "Workday". In the screenshot below, we have weekdays filtered out, so only weekends are visible: If some regional office of your organization works on a different schedule where the days of rest are other than Saturday and Sunday, you can easily adjust the WEEKDAY formula to your needs by specifying a different return_type . For example, to treat Saturday and Monday as weekends, set return_type to 12, so you'll get the "Tuesday (1) to Monday (7)" week type: How to highlight weekends workdays and in Excel. To spot weekends and workdays in your worksheet at a glance, you can get them automatically shaded in different colors.
How do i find out my conception date
How to find out day of conception
How to find out ovulation date
How to find out the last day i worked
How to find out the exact date i got pregnant
How can you find out the day you conceived
JohnSi
ผู้เยี่ยมชม