-->
جاري التحميل ...

054 DATE() CHOOSE( ) WEEKDAY( ) in excel desginTemplates Holidays part1

-1-
-2-

 The 3rd Monday in January   date   equation


 




 كيف احسب تاريخ  يوم     الاثنين  رقم  3   من شهر يناير   سنة     2023


=DATE(C2,1,1)+14+CHOOSE(WEEKDAY(DATE(C2,1,1)),1,2,3,4,5,6,0)


= DATE(C2,1,1)+13+CHOOSE(WEEKDAY(DATE(C2,1,1)),2,1,7,6,5,4,3)


= DATE(C2,1,1)+13+WEEKDAY(DATE(C2,1,1))


The 4th Thursday in November

11  =DATE(C2,11,1)+28+CHOOSE(WEEKDAY(DATE(C2,11,1)),1,0,6,5,4,3,2)


DATE()     

CHOOSE( ) 

WEEKDAY( )  


in excel





The DATE() function in Excel returns the serial number of a date. The syntax is:


DATE(year, month, day)

For example, the following formula will return the serial number for the date January 1, 2023:


=DATE(2023, 1, 1)

The CHOOSE() function in Excel returns a value from a list of values based on a number. The syntax is:

------------------------------------------

CHOOSE(number, value1, value2, ...)

For example, the following formula will return the value "Monday" if the number 1 is passed in, "Tuesday" if the number 2 is passed in, and so on:


=CHOOSE(1, "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")

The WEEKDAY() function in Excel returns the day of the week for a date. The syntax is:


WEEKDAY(date, [return_type])

The optional return_type argument can be used to specify the format of the returned day of the week. The possible values for return_type are:


1: Sunday

2: Monday

3: Tuesday

4: Wednesday

5: Thursday

6: Friday

7: Saturday

The default value for return_type is 1.


For example, the following formula will return the day of the week for the date January 1, 2023:


=WEEKDAY(DATE(2023, 1, 1))

This will return the number 1, which corresponds to Sunday.


The code you provided outputs the following:


2023-08-19

None

The first output, 2023-08-19, is the current date. The second output, None, is because the WEEKDAY() function requires a date as its argument, but the choose() function only returns a string.


To get the day of the week for the current date, you can use the following formula:


=CHOOSE(WEEKDAY(DATE()), "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")


This formula will return the appropriate day of the week string, such as "Sunday" or "Monday".



-3-
-4-

التعليقات



إذا أعجبك محتوى مدونتنا نتمنى البقاء على تواصل دائم ، فقط قم بإدخال بريدك الإلكتروني للإشتراك في بريد المدونة السريع ليصلك جديد المدونة أولاً بأول ، كما يمكنك إرسال رساله بالضغط على الزر المجاور ...

إتصل بنا

جميع الحقوق محفوظة

مدونة كورس 7

2021