Loncat ke daftar isi utama

Bagaimana cara menghitung jam antara waktu setelah tengah malam di Excel?

dokter menghitung waktu lewat semalam 1

Misalkan Anda memiliki tabel waktu untuk mencatat waktu kerja Anda, waktu di Kolom A adalah waktu mulai hari ini dan waktu di Kolom B adalah waktu akhir hari berikutnya. Biasanya, jika Anda menghitung perbedaan waktu antara dua waktu dengan langsung minus "= B2-A2", itu tidak akan menampilkan hasil yang benar seperti gambar di sebelah kiri. Bagaimana Anda bisa menghitung jam antara dua kali setelah tengah malam di Excel dengan benar?

Hitung jam antara dua kali setelah tengah malam dengan rumus


panah gelembung kanan biru Hitung jam antara dua kali setelah tengah malam dengan rumus

Untuk mendapatkan hasil kalkulasi yang benar antara dua kali selama tengah malam, Anda dapat menerapkan rumus berikut:

1. Masukkan rumus ini: =(B2-A2+(B2<A2))*24 (A2 adalah waktu yang lebih awal, B2 adalah waktu nanti, Anda dapat mengubahnya sesuai kebutuhan) menjadi sel kosong yang di samping data waktu Anda, lihat tangkapan layar:

dokter menghitung waktu lewat semalam 2

2. Kemudian seret pegangan isian ke sel yang ingin Anda isi rumus ini, dan perbedaan waktu antara dua kali setelah tengah malam telah dihitung sekaligus, lihat tangkapan layar:

dokter menghitung waktu lewat semalam 3

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 (23)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi All,

So I have a list of employees, all their working dates with start and end time & date.

I need to figure out how many hours were spent after midnight- night hours. The issue is that there are all sort of starting and finish times- some of the shifts were day shift the others started at 9pm till 2am, others started 10pm till next morning 5 am, etc.

Is there a way of calculating this using a generic formula for all lines?

I have tried so many variations but excel does not want to collaborate!
This comment was minimized by the moderator on the site
Hello, Timea,
In fact, the formula in this article can solve your problem, see below screenshot:
https://www.extendoffice.com/images/stories/comments/comment-skyyang/2023-comment/doc-calculate-hours.png
Please have a try, thank you!
This comment was minimized by the moderator on the site
Thank you for your reply.

I only want to know the hours worked after midnight, so only the night hours.
Not total hours worked.
Hope this makes sense.
This comment was minimized by the moderator on the site
Hello, Timea
If you just need to get the hours worked after midnight, the below formula may help you:
=IF(DAYS(B2,A2)>0,(B2-A2+(B2<A2))*24,"")
Please try, hope it can help you!
This comment was minimized by the moderator on the site
Very clever, using the comparison (b2<a2) to return a boolean result so if it's after midnight it adds 1.  It took me a minute to understand what you did it was so elegant. 
This comment was minimized by the moderator on the site
Hello,
You are welcome. Glad it helps. Any questions, please feel free to contact us. Have a great day.
Sincerely,
Mandy
This comment was minimized by the moderator on the site
This doesn't work with all data. The solution I tried after trying the above was =IF(B22>C22,(C22-0)+(24-B22),C22-B22)
This comment was minimized by the moderator on the site
=IF(B22>C22,(C22-0)+(24-B22),C22-B22) is perfect but instead of ( , ) use ( ; )
thankyouverymuch
This comment was minimized by the moderator on the site
Doesn't work for me... Formula incorrect.
This comment was minimized by the moderator on the site
Great solution, very useful! Thanks :)
This comment was minimized by the moderator on the site
Hi, i need help please. I have data that auto loads daily at 5pm. The process is broken into 2 parts (ETL1 and ETL2). ETL1 starts at 5pm till 11pm and ETL2 starts at 11 till 4 am. at 7 am i run a script to check if everything ran. each row has a start and end date time. i would like to flag all data after 5pm yesterday as todays data. Currently when i filter on today, i only see the rows where the date is after 00:00
This comment was minimized by the moderator on the site
Can someone explain when the function of addition of the TRUE/FALSE values does so I can understand the formula please?
This comment was minimized by the moderator on the site
True = 1, False = 0
This comment was minimized by the moderator on the site
I think a simple MOD(B2-A2,1) should be enough?
This comment was minimized by the moderator on the site
This is undoubtedly the best and shortest solution.
This comment was minimized by the moderator on the site
Austin, the formula stated in the article above works well for me
This comment was minimized by the moderator on the site
The formula under bullet point #1 is wrong. =(B2-A2+(B2<A2))*24, but is should read as =B2-A2+(B2<A2)*24.

The parentheses are in the wrong spot.
This comment was minimized by the moderator on the site
THANK YOU! This is definitely the correct formula.
This comment was minimized by the moderator on the site
Yes Austin! Your formula works, the other formula renders nonsense (in my case). Thanks!!
This comment was minimized by the moderator on the site
No, Austin's correction works for me. The original with the parentheses where they are shown does not work. Maybe a diifferent version of Excel makes a difference? I am on MS Home and Office 2016
This comment was minimized by the moderator on the site
The original formula works better than your suggestion Austin.
I also used =(A2-B2+(A2<B2))*1440
This worked best to convert time into minutes.
This comment was minimized by the moderator on the site
Depois de colocar a formatação ao tentar somar a coluna total de horas o valor dá-me errado.

O campo é formatado [h]mm
This comment was minimized by the moderator on the site
=(A2-B2+(A2)) sem utilizar a multiplicação por 24
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations