انتقل إلى المحتوى الرئيسي

كيفية تقريب التاريخ إلى يوم الأسبوع المحدد السابق أو التالي في Excel؟

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

السهم الأزرق الحق فقاعة موعد الجولة إلى يوم الأسبوع المحدد التالي

على سبيل المثال ، هنا للحصول على يوم الأحد القادم من التواريخ في العمود أ

1. حدد الخلية التي تريد وضعها في تاريخ الأحد التالي ، ثم الصق أو أدخل الصيغة أدناه:

=IF(MOD(A2-1,7)>7,A2+7-MOD(A2-1,7)+7,A2+7-MOD(A2-1,7))

2. ثم اضغط أدخل مفتاح للحصول على أول يوم الأحد المقبل ، والذي يتم عرضه كرقم مكون من 5 أرقام ، ثم اسحب التعبئة التلقائية لأسفل للحصول على جميع النتائج.

وثيقة من جولة إلى الأحد السابق 1

3. ثم احتفظ بخلايا الصيغة المحددة ، اضغط كترل + شنومكس لعرض ملفات تنسيق الخلايا الحوار ، ثم تحت رقم الهاتف علامة التبويب، حدد التاريخ واختر نوع تاريخ واحد من القائمة الصحيحة حسب حاجتك. انقر OK.

وثيقة من جولة إلى الأحد السابق 1

الآن تم عرض نتائج الصيغة بتنسيق التاريخ.

وثيقة من جولة إلى الأحد السابق 1

للحصول على يوم آخر من أيام الأسبوع القادمة ، يرجى استخدام الصيغ التالية:

يوم من أيام الأسبوع المعادلة
الأحد =IF(MOD(A2-1,7)>7,A2+7-MOD(A2-1,7)+7,A2+7-MOD(A2-1,7))
السبت =IF(MOD(A2-1,7)>6,A2+6-MOD(A2-1,7)+7,A2+6-MOD(A2-1,7))
الجمعة =IF(MOD(A2-1,7)>5,A2+5-MOD(A2-1,7)+7,A2+5-MOD(A2-1,7))
الخميس =IF(MOD(A2-1,7)>4,A2+4-MOD(A2-1,7)+7,A2+4-MOD(A2-1,7))
الأربعاء =IF(MOD(A1-1,7)>3,A1+3-MOD(A1-1,7)+7,A1+3-MOD(A1-1,7))
؛يوم الثلاثاء =IF(MOD(A1-1,7)>2,A1+2-MOD(A1-1,7)+7,A1+2-MOD(A1-1,7))
الإثنين =IF(MOD(A1-1,7)>1,A1+1-MOD(A1-1,7)+7,A1+1-MOD(A1-1,7))

السهم الأزرق الحق فقاعة تاريخ الجولة ليوم الأسبوع المحدد السابق

على سبيل المثال ، هنا للحصول على يوم الأحد السابق للتواريخ الموجودة في العمود أ

1. حدد الخلية التي تريد وضعها في تاريخ الأحد التالي ، ثم الصق أو أدخل الصيغة أدناه:

= A2-WEEKDAY (A2,2،XNUMX)

2. ثم اضغط أدخل مفتاح للحصول على أول يوم الأحد المقبل ، ثم اسحب التعبئة التلقائية لأسفل للحصول على جميع النتائج.

وثيقة من جولة إلى الأحد السابق 1

إذا كنت تريد تغيير تنسيق التاريخ ، فاحتفظ بخلايا الصيغة محددة ، اضغط على كترل + شنومكس لعرض ملفات تنسيق الخلايا الحوار ، ثم تحت رقم الهاتف علامة التبويب، حدد التاريخ واختر نوع تاريخ واحد من القائمة الصحيحة حسب حاجتك. انقر OK.

وثيقة من جولة إلى الأحد السابق 1

الآن تم عرض نتائج الصيغة بتنسيق التاريخ.

وثيقة من جولة إلى الأحد السابق 1

للحصول على أيام الأسبوع الأخرى السابقة ، يرجى استخدام الصيغ التالية:

يوم من أيام الأسبوع المعادلة
الأحد = A2-WEEKDAY (A2,2،XNUMX)
السبت =IF(WEEKDAY(A2,2)>6,A2-WEEKDAY(A2,1),A2-WEEKDAY(A2,2)-1)
الجمعة =IF(WEEKDAY(A2,2)>5,A2-WEEKDAY(A2,2)+5,A2-WEEKDAY(A2,2)-2)
الخميس =IF(WEEKDAY(A2,2)>4,A2-WEEKDAY(A2,2)+4,A2-WEEKDAY(A2,2)-3)
الأربعاء =IF(WEEKDAY(A2,2)>3,A2-WEEKDAY(A2,2)+3,A2-WEEKDAY(A2,2)-4)
؛يوم الثلاثاء =IF(WEEKDAY(A2,2)>2,A2-WEEKDAY(A2,2)+2,A2-WEEKDAY(A2,2)-5)
الإثنين =IF(WEEKDAY(A2,2)>1,A2-WEEKDAY(A2,2)+1,A2-WEEKDAY(A2,2)-6)

مساعد قوي للتاريخ والوقت

مساعد التاريخ والوقت سمة من سمات كوتولس ل إكسيل، يدعم إضافة / طرح وقت التاريخ بسهولة ، وحساب الفرق بين تاريخين ، وعمر calcualte بناءً على تاريخ الميلاد.  انقر للحصول على نسخة تجريبية مجانية!
وثيقة من جولة إلى الأحد السابق 1
 
Kutools for Excel: مع أكثر من 200 وظيفة إضافية مفيدة في Excel ، يمكنك تجربتها مجانًا دون قيود.

أفضل أدوات إنتاجية المكتب

🤖 مساعد Kutools AI: إحداث ثورة في تحليل البيانات على أساس: التنفيذ الذكي   |  إنشاء التعليمات البرمجية  |  إنشاء صيغ مخصصة  |  تحليل البيانات وإنشاء الرسوم البيانية  |  استدعاء وظائف Kutools...
الميزات الشعبية: البحث عن التكرارات أو تمييزها أو تحديدها   |  حذف الصفوف الفارغة   |  دمج الأعمدة أو الخلايا دون فقدان البيانات   |   جولة بدون صيغة 
سوبر بحث: معايير متعددة VLookup    VLookup ذات القيمة المتعددة  |   VLookup عبر أوراق متعددة   |   بحث غامض ....
قائمة منسدلة متقدمة: إنشاء القائمة المنسدلة بسرعة   |  القائمة المنسدلة التابعة   |  قائمة منسدلة متعددة التحديد ....
مدير العمود: إضافة عدد محدد من الأعمدة  |  نقل الأعمدة  |  تبديل حالة رؤية الأعمدة المخفية  |  مقارنة النطاقات والأعمدة 
الميزات المميزة: التركيز على الشبكة   |  عرض تصميم   |   شريط الفورمولا الكبير    مدير المصنفات والأوراق   |  مكتبة الموارد (النص السيارات)   |  منتقي التاريخ   |  اجمع أوراق العمل   |  تشفير/فك تشفير الخلايا    إرسال رسائل البريد الإلكتروني عن طريق القائمة   |  سوبر تصفية   |   مرشح خاص (تصفية غامق / مائل / يتوسطه خط ...) ...
أفضل 15 مجموعة أدوات12 نص الأدوات (إضافة نص, إزالة الأحرف، ...)   |   +50 رسم الأنواع (مخطط جانت، ...)   |   40+ عملي الصيغ (احسب العمر على أساس تاريخ الميلاد، ...)   |   19 إدخال الأدوات (أدخل رمز الاستجابة السريعة, إدراج صورة من المسار، ...)   |   12 تحويل الأدوات (أرقام إلى كلمات, نتيجة تحويل عملة، ...)   |   7 دمج وتقسيم الأدوات (الجمع بين الصفوف المتقدمة, تقسيم الخلايا، ...)   |   ... و اكثر

عزز مهاراتك في Excel باستخدام Kutools for Excel، واختبر كفاءة لم يسبق لها مثيل. يقدم Kutools for Excel أكثر من 300 ميزة متقدمة لتعزيز الإنتاجية وتوفير الوقت.  انقر هنا للحصول على الميزة التي تحتاجها أكثر...

الوصف


يجلب Office Tab الواجهة المبوبة إلى Office ، ويجعل عملك أسهل بكثير

  • تمكين التحرير والقراءة المبوبة في Word و Excel و PowerPointوالناشر والوصول و Visio والمشروع.
  • فتح وإنشاء مستندات متعددة في علامات تبويب جديدة من نفس النافذة ، بدلاً من النوافذ الجديدة.
  • يزيد من إنتاجيتك بنسبة 50٪ ، ويقلل مئات النقرات بالماوس كل يوم!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I have tested this but partially incorrect result was out. Why ?
I wanted to get next Friday.

=IF(A2="","",A2+5-Mod(A2-1,7))

I have entered 11/19/2022
The result was past day 11/18/2022
This comment was minimized by the moderator on the site
Thanks for your reminder, the original formula is not enough rigorous indeed. I have updated the formulas and rewrited the tutorial, hope the new formulas can help you.
This comment was minimized by the moderator on the site
Im trying to work out how to use a date, less an amount of days but ensure when subtracting the days it lands on a weekday not a weekend.
Any formulas??
This comment was minimized by the moderator on the site
Hi Everyone,
I use the formula below to round to the next Thursday where A1 is the cell with your original date and 14 is for Thursday. You can use other numbers for other days if required. 11=Monday, 12=Tuesday, 13=Wednesday, etc...

Also, you can use a 1 instead of an 8 to get the Thursday before your original date in A1. If your original date is already a Thursday the formula will produce the same date as in A1.

I hope this helps!

=A1+(0-WEEKDAY(A1,14)+8)
This comment was minimized by the moderator on the site
Thank you! This worked :)
This comment was minimized by the moderator on the site
I put this into google sheets and to make the dates become next thursday but I have not been able to get it to work especially for the dates right after thursdays. =IF(L2="","",L2+4-MOD(L2-1,4)) is the function i used to make it thursday but not all dates were thursday.
This comment was minimized by the moderator on the site
to clarify, all dates become thursday, but friday and saturday will not convert to the next weeks thursday instead they will go back a day or two to the previous thursday instead going to next weeks thursday, is there any way to fix this in the function =IF(L4="","",L4+4-MOD(L4-1,7))
This comment was minimized by the moderator on the site
Hi Kisho,

I use the formula below to round to the next Thursday where A1 is the cell with your original date and 14 is for Thursday. You can use other numbers for other days if required. 11=Monday, 12=Tuesday, 13=Wednesday, etc...

Also, you can use a 1 instead of an 8 to get the Thursday before your original date in A1. If your original date is already a Thursday the formula will produce the same date as in A1.

I hope this helps!

=A1+(0-WEEKDAY(A1,14)+8)
This comment was minimized by the moderator on the site
Hi Kisho,
I use the formula below to round to the next Thursday where A1 is the cell with your original date and 14 is for Thursday. You can use other numbers for other days if required. 11=Monday, 12=Tuesday, 13=Wednesday, etc...
Also, you can use a 1 instead of an 8 to get the Thursday before your original date in A1. If your original date is already a Thursday the formula will produce the same date as in A1.
I hope this helps!
=A1+(0-WEEKDAY(A1,14)+8)
This comment was minimized by the moderator on the site
I put this into google sheets and to make the dates become next thursday but I have not been able to get it to work especially for the dates right after thursdays. =IF(L2="","",L2+4-MOD(L2-1,4)) is the function i used to make it thursday but not all dates were thursday.
This comment was minimized by the moderator on the site
Si quiero la fecha del próximo viernes cómo debo modificar las variables? Gracias
This comment was minimized by the moderator on the site
Sorry, I cannot understand, could you speak in English?
This comment was minimized by the moderator on the site
hi guys,

I used the formula below, I hope it works for you.
IF(WEEKDAY(H2,16)<>7,(7-WEEKDAY(H2,16))+H2,H2) where H2 is the date that you want to round up to the next day of the week (in my case for Friday) and the 16 is the format to start the date with Saturday as #1 and Friday as #7.
This comment was minimized by the moderator on the site
Your round to previous Sunday is flawed. Even shows as much on your sheet.
This comment was minimized by the moderator on the site
So, what would be the correct formula to first check to see if a cell has a date, else leave it blank and make the date the fall on a Friday before if the date falls on a Saturday or Sunday?
This comment was minimized by the moderator on the site
I found a workaround for to the previous Friday. You can change the switch "results" as needed to round to different days.=H3-SWITCH(TEXT(H3, "DDD"), "Mon", 3, "Tue", 4, "Wed", 5, "Thu", 6, "Fri", 0, "Sat", 1, "Sun", 2)
=[date]-SWITCH(TEXT([date], "DDD"), "Mon", 3, "Tue", 4, "Wed", 5, "Thu", 6, "Fri", 0, "Sat", 1, "Sun", 2)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations