ไปยังเนื้อหาหลัก

จะค้นหาวันศุกร์แรกหรือวันสุดท้ายของทุกเดือนใน Excel ได้อย่างไร

โดยปกติวันศุกร์เป็นวันทำงานสุดท้ายในหนึ่งเดือน คุณจะค้นหาวันศุกร์แรกหรือวันศุกร์สุดท้ายตามวันที่กำหนดใน Excel ได้อย่างไร ในบทความนี้เราจะแนะนำคุณเกี่ยวกับวิธีการใช้สองสูตรในการค้นหาวันศุกร์แรกหรือวันศุกร์สุดท้ายของทุกเดือน

ค้นหาวันศุกร์แรกของเดือน
ค้นหาวันศุกร์สุดท้ายของเดือน


ค้นหาวันศุกร์แรกของเดือน

ตัวอย่างเช่นมีวันที่ที่กำหนด 1/1/2015 อยู่ในเซลล์ A2 ตามภาพด้านล่างที่แสดง หากคุณต้องการค้นหาวันศุกร์แรกของเดือนตามวันที่ระบุโปรดทำดังนี้

1. เลือกเซลล์ที่จะแสดงผลลัพธ์ ที่นี่เราเลือกเซลล์ C2

2. คัดลอกและวางสูตรด้านล่างลงในสูตรนั้นจากนั้นกดปุ่ม เข้าสู่ กุญแจ

=CEILING(EOMONTH(A2,-1)-5,7)+6

จากนั้นวันที่จะแสดงในเซลล์ C2 หมายความว่าวันศุกร์แรกของเดือนมกราคม 2015 คือวันที่ 1/2/2015

หมายเหตุ / รายละเอียดเพิ่มเติม:

1. หากคุณต้องการค้นหาวันศุกร์แรกของเดือนอื่น ๆ โปรดป้อนวันที่ที่ระบุของเดือนนั้นลงในเซลล์ A2 จากนั้นใช้สูตร

2. ในสูตร A2 คือเซลล์อ้างอิงที่ระบุวันที่ คุณสามารถเปลี่ยนแปลงได้ตามความต้องการของคุณ

ค้นหาวันศุกร์สุดท้ายของเดือน

วันที่ 1/1/2015 ที่ระบุอยู่ในเซลล์ A2 สำหรับการค้นหาวันศุกร์สุดท้ายของเดือนนี้ใน Excel โปรดทำดังนี้

1. เลือกเซลล์คัดลอกสูตรด้านล่างลงไปจากนั้นกดปุ่ม เข้าสู่ กุญแจสำคัญในการรับผลลัพธ์

=DATE(YEAR(A2),MONTH(A2)+1,0)+MOD(-WEEKDAY(DATE(YEAR(A2),MONTH(A2)+1,0),2)-2,-7)

จากนั้นวันศุกร์สุดท้ายของเดือนมกราคม 2015 จะแสดงเซลล์ B2

หมายเหตุ: คุณสามารถเปลี่ยน A2 ในสูตรเป็นเซลล์อ้างอิงของวันที่ที่คุณกำหนดได้


บทความที่เกี่ยวข้อง:

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
Comments (11)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Even shorter 😅
=lambda(Date;WeekDay;EOMONTH(Date;0)-WEEKDAY(EOMONTH(Date;0);WeekDay+10)+1
Where "WeekDay" parameter is 1=Monday, 7=Sunday
This comment was minimized by the moderator on the site
=lambda(Date;WeekDay;EOMONTH(Date;0)-WEEKDAY(EOMONTH(Date;0);WeekDay+10)+1)

I forgot a bracket at the end
This comment was minimized by the moderator on the site
Vậy công thức tính thứ sáu tuần thứ 2 của tháng như thế nào vậy ban?
This comment was minimized by the moderator on the site
Hi Tâm Cao Điền,
Suppose you want to calculate the second friday of the month based on the given date in A1, you can try the following formula:
=A18-DAY(A18)+CHOOSE(WEEKDAY(A18-DAY(A18),2),11,10,9,8,14,13,12)
This comment was minimized by the moderator on the site
porque cuando lo pruebo tal cual me sale error ?
o sea estoy copiando y pegando y no funciona

alguien sabe?
This comment was minimized by the moderator on the site
Hi andre,
Can you tell me which formula you used in the post? And what error your are experiencing?
This comment was minimized by the moderator on the site
Why not make the "last Friday" formula: =CEILING(EOMONTH(A2,0)-5,7)-1? That works for all dates I have tried....
This comment was minimized by the moderator on the site
Hi Eric,
Thanks for sharing it.
This comment was minimized by the moderator on the site
Hello and thank you for this formula. I am not an Excel guru and acnnot easily work out how to change this formula for the last Friday to be the Last Monday, or any other day. Can you please explain how to interpret this.
This comment was minimized by the moderator on the site
Matt,

The way the formula works is: First we find the last day of the month with the EOMONTH() function. For the last day of the current month, we use "0" as the month offset. For the previous month, it would be -1. (Either "=EOMONTH(A2,0)" or "=EOMONTH(A2,-1)".)

Then, in the "=CEILING()" function, we subtract the number of days required to bring us back to Sunday from the day for which we are searching. (For Tuesday, it would be -2, so we make the formula so far: "=CEILING(EOMONTH(A2,0)-2...."

We use the "significance" value of "7" because weeks are seven days long (of course).This finds the date of either the previous Saturday, or the following Saturday (Excel dates started with 1/1/1900, which was a Sunday. So if you enter a "1" in cell A2 with the Long Date format, the cell would read: "Sunday, January 1, 1900".). For that reason, the =CEILING() function, using "7" as the "significance" argument returns Saturday, which is always a multiple of 7 in Excel. Now the formula is "=CEILING(EOMONTH(A2,0)-2,7...".

Now we need to return the date to a Tuesday, so we either subtract 4 for the last Tuesday of the month, or add 3 for the first Tuesday of the next month. So the final formula is, respectively, either "=CEILING(EOMONTH(A2,0)-2,7)-4" or "=CEILING(EOMONTH(A2,0)-2,7)+3".

We can work through the math by assuming the last day of the month is either a Monday (assume its value is 9 - for ease of illustration, so the values do not go negative) or a Wednesday (assume value 11). "EOMONTH()" will return either of those days (9 or 11). Subtracting 2 results in the previous Saturday (value 7) or Monday (value 9), respectively. The CEILING() function then returns, respectively, the previous Saturday (value 7, because the ceiling of 7 with significance 7 is 7) or the current Saturday (value 14, because the ceiling of 9, significance 7, is 14). Subtracting 4 results in the previous Tuesday (value 3) or the current week's Tuesday (value 10), respectively. For the first Tuesday of the following month, adding 3 to the Saturday value (7 or 14) returns either Tuesday value 10, or Tuesday value 17, respectively.


Hopefully that helps you understand so that you can modify the formula as necessary. You can even change it to find the second Tuesday, or second to last Tuesday, by adding or subtracting an additional 7, respectively.
This comment was minimized by the moderator on the site
Hi Matt,
You just need to change the last number -7 to -1 to solove the problem.
=DATE(YEAR(A2),MONTH(A2)+1,0)+MOD(-WEEKDAY(DATE(YEAR(A2),MONTH(A2)+1,0),2)-2,-1)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations