Loncat ke daftar isi utama

Bagaimana menghitung jumlah akhir pekan / hari kerja antara dua tanggal di Excel?

Terkadang, kita perlu mengetahui berapa hari kerja tertentu di antara dua tanggal. Misalnya, saya punya dua tanggal: tanggal mulai 1/1/2014 dan tanggal berakhirnya 2/15/2014, sekarang saya ingin tahu berapa kali Minggu atau Senin atau Selasa dll terjadi dalam durasi ini. Mungkin ini agak sulit bagi kami, tetapi di sini, saya dapat berbicara tentang beberapa metode efektif untuk Anda.


Hitung jumlah hari kerja / akhir pekan tertentu antara dua tanggal dengan rumus

Misalkan, saya memiliki dua tanggal berikut, dan saya perlu menghitung berapa hari Minggu di antara keduanya. Pilih sel kosong, masukkan rumus di bawah, dan tekan Enter kunci. Dan sekarang Anda akan mendapatkan jumlah hari Minggu di antara kedua tanggal tersebut. Lihat tangkapan layar:

=INT((WEEKDAY($C$2- 1)-$C$2+$C3)/7)

Catatan:

(1) Dalam rumus di atas, C2 adalah tanggal mulai dan C3 menunjukkan tanggal akhir.

(2) Dalam rumus di atas, 1 singkatan dari Sunday. Dan Anda dapat mengganti angka 1 dengan angka lain antara 1 dan 7. (1 Minggu, 2 Senin, 3 Selasa, 4 Rabu, 5 Kamis, 6 Jumat dan 7 Sabtu)


Gunakan rumus untuk menghitung jumlah hari kerja tertentu dalam sebulan

Kadang-kadang, Anda mungkin perlu menghitung jumlah hari kerja tertentu di bulan tertentu, mengatakan menghitung jumlah total hari Rabu di bulan Juli 2020. Di sini, saya akan memperkenalkan rumus untuk menghitung jumlah hari kerja tertentu di bulan dengan mudah.

Pilih sel kosong, ketik rumus di bawah ini, dan tekan tombol Enter untuk mendapatkan hasil penghitungan.

=INT((WEEKDAY(DATE(G2,G3,1)- G4)-DATE(G2,G3,1)+EOMONTH(DATE(G2,G3,1),0))/7)

Catatan:

(1) Dalam rumus di atas, G2 adalah tahun yang ditentukan, G3 adalah bulan yang ditentukan, dan G4 adalah hari tertentu dalam seminggu.

(2) Rumus ini menetapkan bilangan bulat untuk mewakili hari minggu: 1 Minggu, 2 Senin, 3 Selasa, 4 Rabu, 5 Kamis, 6 Jumat, dan 7 Sabtu.


Gunakan Fungsi Buatan Pengguna untuk menghitung jumlah hari kerja / akhir pekan tertentu dalam bulan tertentu

Anda juga dapat membuat Fungsi Buatan Pengguna untuk menghitung berapa hari kerja tertentu dalam tahun dan bulan tertentu selain rumus di atas.

1. Tahan ALT + F11 kunci, dan itu membuka Jendela Microsoft Visual Basic for Applications.

2. Klik Menyisipkan > Modul, dan tempel kode berikut di Jendela Modul.

Public Function TotalDays(pYear As Integer, pMonth As Integer, pDay As Integer)
'Update 20140210
Dim xindex As Integer
Dim endDate As Integer
endDate = Day(DateSerial(pYear, pMonth + 1, 0))
For xindex = 1 To endDate
    If Weekday(DateSerial(pYear, pMonth, xindex)) = pDay Then
        TotalDays = TotalDays + 1
    End If
Next
End Function

3. Simpan kode ini dan kembali ke lembar kerja, lalu di sel kosong, masukkan rumus ini = TotalDays (tahun, bulan, 1) . Dalam contoh ini, saya akan menghitung ada berapa hari Minggu di bulan Juni 2020, jadi saya dapat menerapkan rumus ini sebagai salah satu rumus di bawah ini, Lalu tekan Enter kunci, dan Anda akan mendapatkan berapa hari Minggu sekaligus. lihat tangkapan layar:

= TotalDays (C2, C3, C4)

= TotalDays (2020,6,1)

 

Catatan: Rumus ini menggunakan bilangan bulat untuk mewakili hari dalam minggu: 1 Minggu, 2 Senin, 3 Selasa, 4 Rabu, 5 Kamis, 6 Jumat dan 7 Sabtu.


Hitung jumlah semua akhir pekan / hari kerja / hari tertentu dalam seminggu antara dua tanggal dengan Kutools for Excel

Sebenarnya, kita bisa menerapkan Kutools for Excel's Jumlah hari non-kerja antara dua tanggal rumus, Jumlah hari kerja antara dua tanggal formula, dan Hitung jumlah hari kerja tertentu rumus untuk menghitung dengan cepat jumlah semua akhir pekan, akhir pekan, atau hari tertentu dalam seminggu dalam rentang tanggal di Excel.

Kutools untuk Excel - Dilengkapi dengan lebih dari 300 alat penting untuk Excel. Nikmati uji coba GRATIS 30 hari berfitur lengkap tanpa memerlukan kartu kredit! Unduh sekarang!

1. Pilih sel kosong Anda akan menempatkan hasil penghitungan, dan klik Kutools> Pembantu Formula> Pembantu Formula untuk mengaktifkan fitur ini

Dan kemudian lanjutkan berdasarkan jenis penghitungan Anda.

A. Hitung jumlah akhir pekan (Sabtu dan Minggu) antara dua tanggal di Excel

Dalam dialog Pembantu Rumus, lakukan hal berikut:
(1) Pilih Statistik dari Jenis Formula daftar drop-down;
(2) Klik untuk memilih Jumlah hari non-kerja antara dua tanggal dalam Pilih rumus kotak daftar;
(3) Masukkan tanggal mulai di Tanggal Mulai kotak (Anda juga bisa merujuk sel tanggal);
(4) Masukkan tanggal akhir di Tanggal Akhir kotak (Anda juga bisa merujuk sel tanggal);
(5) Klik OK .

Sekarang mengembalikan jumlah semua hari Sabtu dan Minggu di sel yang dipilih.

Kutools untuk Excel - Tingkatkan Excel dengan lebih dari 300 alat penting. Nikmati uji coba GRATIS 30 hari berfitur lengkap tanpa memerlukan kartu kredit! Get It Now

B. Hitung jumlah hari kerja (tidak termasuk Sabtu dan Minggu) antara dua tanggal di Excel

Dalam dialog Pembantu Rumus, lakukan hal berikut:
(1) Pilih Statistik dari Jenis Formula daftar drop-down;
(2) Klik untuk memilih Jumlah hari kerja antara dua tanggal dalam Pilih rumus kotak daftar;
(3) Masukkan tanggal mulai di Tanggal Mulai kotak (Anda juga bisa merujuk sel tanggal);
(4) Masukkan tanggal akhir di Tanggal Akhir kotak (Anda juga bisa merujuk sel tanggal);
(5) Klik OK .

Dan kemudian mengembalikan jumlah hari kerja (tidak termasuk Sabtu dan Minggu) di sel yang dipilih.

Kutools untuk Excel - Tingkatkan Excel dengan lebih dari 300 alat penting. Nikmati uji coba GRATIS 30 hari berfitur lengkap tanpa memerlukan kartu kredit! Get It Now

C. Hitung jumlah hari tertentu dalam seminggu (Senin, Sabtu, Minggu, dll) antara dua tanggal di Excel

Dalam dialog Pembantu Rumus, lakukan hal berikut:
(1) Pilih Statistik dari Jenis Formula daftar drop-down;
(2) Klik untuk memilih Hitung jumlah hari kerja tertentu dalam Pilih rumus kotak daftar;
(3) Masukkan tanggal mulai di Tanggal Mulai kotak (Anda juga bisa merujuk sel tanggal);
(4) Masukkan tanggal akhir di Tanggal Akhir kotak (Anda juga bisa merujuk sel tanggal);
(5) Tentukan hari kerja tertentu dengan bilangan bulat (1 menunjukkan Minggu, 2-5 berarti Senin hingga Jumat, dan 7 berarti Sabtu.);
(6) Klik OK .

Dan kemudian mengembalikan jumlah total hari kerja yang ditentukan dalam rentang tanggal tertentu.

Kutools untuk Excel - Tingkatkan Excel dengan lebih dari 300 alat penting. Nikmati uji coba GRATIS 30 hari berfitur lengkap tanpa memerlukan kartu kredit! Get It Now


Artikel terkait:

Alat Produktivitas Kantor Terbaik

🤖 Kutools AI Ajudan: Merevolusi analisis data berdasarkan: Eksekusi Cerdas   |  Hasilkan Kode  |  Buat Rumus Khusus  |  Analisis Data dan Hasilkan Grafik  |  Aktifkan Fungsi Kutools...
Fitur Populer: Temukan, Sorot, atau Identifikasi Duplikat   |  Hapus Baris Kosong   |  Gabungkan Kolom atau Sel tanpa Kehilangan Data   |   Putaran tanpa Formula ...
Pencarian Super: VLookup Beberapa Kriteria    VLookup Nilai Berganda  |   VLookup di Beberapa Lembar   |   Pencarian Fuzzy ....
Daftar Drop-down Lanjutan: Buat Daftar Drop Down dengan Cepat   |  Daftar Drop Down yang Bergantung   |  Multi-pilih Drop Down List ....
Manajer Kolom: Tambahkan Jumlah Kolom Tertentu  |  Pindahkan Kolom  |  Alihkan Status Visibilitas Kolom Tersembunyi  |  Bandingkan Rentang & Kolom ...
Fitur Unggulan: Fokus Kisi   |  Tampilan Desain   |   Bar Formula Besar    Manajer Buku Kerja & Lembar   |  Perpustakaan Sumberdaya (Teks otomatis)   |  Pemetik tanggal   |  Gabungkan Lembar Kerja   |  Enkripsi/Dekripsi Sel    Kirim Email berdasarkan Daftar   |  Filter Super   |   Filter Khusus (filter tebal/miring/coret...) ...
15 Perangkat Teratas12 Teks Tools (Tambahkan Teks, Hapus Karakter, ...)   |   50 + Grafik jenis (Gantt Chart, ...)   |   40+ Praktis Rumus (Hitung usia berdasarkan ulang tahun, ...)   |   19 Insersi Tools (Masukkan Kode QR, Sisipkan Gambar dari Jalur, ...)   |   12 Konversi Tools (Angka ke Kata, Konversi Mata Uang, ...)   |   7 Gabungkan & Pisahkan Tools (Lanjutan Gabungkan Baris, Pisahkan Sel, ...)   |   ... dan banyak lagi

Tingkatkan Keterampilan Excel Anda dengan Kutools for Excel, dan Rasakan Efisiensi yang Belum Pernah Ada Sebelumnya. Kutools for Excel Menawarkan Lebih dari 300 Fitur Lanjutan untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

Deskripsi Produk


Tab Office Membawa antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Jauh Lebih Mudah

  • Aktifkan pengeditan dan pembacaan tab di Word, Excel, PowerPoint, Publisher, Access, Visio, dan Project.
  • Buka dan buat banyak dokumen di tab baru di jendela yang sama, bukan di jendela baru.
  • Meningkatkan produktivitas Anda sebesar 50%, dan mengurangi ratusan klik mouse untuk Anda setiap hari!
Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Let's say you want to calculate the 3rd Thursday of the month and assume the date of the first of the month is in cell A1. We need to first work out the date of the Thursday in the week of A1. Because Thursday is the 5th day of the week, we use: =A1-WEEKDAY(A1)+5 Then if this Thursday falls before A1, we need to add 7 using [b]((A1-WEEKDAY(A1)+5)
This comment was minimized by the moderator on the site
What about a formula that returns the actual date of the first Wed of each month, Or the 2nd and 3rd tuesday of each month? Or every 3rd tuesday? I want to be able to put in my own start and end dates and then get the actual DATES (not the count) returned to me. Any ideas?
This comment was minimized by the moderator on the site
hi sir, i want to calculate no. of weeks in excel between two dates, but Dose not see right weeks as per date for example: I enterd the date 01/01/2016 ( Friday) and second date 14/01/2016( thursday) no of weeks showing = 2 weeks. but i want to show exact 2 weeks completed 15/01/2016 other wise show previse no fo weeks.
This comment was minimized by the moderator on the site
Let the start and end dates be in cells A1 and A2, respectively. This should work: =INT((A2-A1)/7)
This comment was minimized by the moderator on the site
Is it possible to have the start date set to "=today()" and the end date, for example, the 22nd of the current cycle. As the date returns to the 23rd, refresh the formula to the following 22nd?
This comment was minimized by the moderator on the site
Assuming cycle refers to month, this should work for the end date: DATE(YEAR(TODAY()),MONTH(TODAY())+IF(DAY(TODAY())>22,1,0),22)
This comment was minimized by the moderator on the site
Why are my comments not published completely????
This comment was minimized by the moderator on the site
[quote]Why are my comments not published completely????By Mohamed[/quote] Sorry, please try to send me the formula to jaychivo#extendoffice.com. Please replace @ with #. And i will help you post it. May be there are some characters which have been blocked. :-)
This comment was minimized by the moderator on the site
Hi Jaco, You may achieve this for someone who works Mondays (2), Wednesdays (4) and Fridays (6) as follows: (1) Call the year's start and end dates [quote]StartDate[/quote] and [quote]EndDate[/quote], respectively. (2) List all the public holidays in South Africa (this could span more than one year) in a range and call it [quote]PublicHolidays[/quote] (3) To calculate the total number of days worked enter the following array formula: [quote]=INT((WEEKDAY(StartDate-2)-StartDate+EndDate )/7)+INT((WEEKDAY(StartDate-4)-StartDate+EndDate )/7)+INT((WEEKDAY(StartDate-6)-StartDate+EndDate )/7)-SUM(IF((PublicHolidays>=StartDate)*(PublicHolidays
This comment was minimized by the moderator on the site
Sorry the formula above is not complete: It should be: =INT((WEEKDAY(StartDate-2)-StartDate+EndDate)/7)+INT((WEEKDAY(StartDate-4)-StartDate+EndDate)/7)+INT((WEEKDAY(StartDate-6)-StartDate+EndDate)/7)-SUM(IF((PublicHolidays>=StartDate)*(PublicHolidays
This comment was minimized by the moderator on the site
I don't know what happened to my formula and the rest of my message above. The formula should be: =INT((WEEKDAY(StartDate-2)-StartDate+EndDate )/7)+INT((WEEKDAY(StartDate-4)-StartDate+EndDate)/7)+INT((WEEKDAY(StartDate-6)-StartDate+EndDate )/7)-SUM(IF((PublicHolidays>=StartDate)*(PublicHolidays
This comment was minimized by the moderator on the site
Hi, I am from South Africa and I need advice. I have two workers at work who works different days. Now I want to type in a formula in excel to count how many days a year she work (that I can do), but the trick comes in when I want to type in a formula which allows me to deduct if one of her working days is a public holiday for example she works Monday, Wednesday and Friday. That means she works 156 days per year, but I want excel to deduct the holidays if it is on one of her working days. Can someone please assist me?
This comment was minimized by the moderator on the site
Does not work properly. You need to consider what day you're starting from and ending with!
This comment was minimized by the moderator on the site
Hi Laura, Could you please elaborate?
This comment was minimized by the moderator on the site
Thank you for this. Question, how do I add another day like "Wednesday or 4" to the Monday? Basically I want it to calculate both the total of Mondays and Wednesdays between the two dates. How do I write this formula? Thanks again
This comment was minimized by the moderator on the site
To help future seekers. Use this formula for calculating days between two dates: =NETWORKDAYS.INTL( start_date, end_date, [weekend], [holidays] ) =NETWORKDAYS.INTL(A3,A4,"00000011",C3:C8) - 0=include day 1=exclude day
This comment was minimized by the moderator on the site
THANK YOU VERY MUCH!!! This is perfect! This function exactly does the task!
This comment was minimized by the moderator on the site
Try =INT((WEEKDAY($B$1-2)-$B$1+$B2)/7)+INT((WEEKDAY($B$1-4)-$B$1+$B2)/7)
This comment was minimized by the moderator on the site
Thank You. This is so useful.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations