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

كيف تحسب الساعات بين الأوقات بعد منتصف الليل في إكسيل؟

doc حساب الوقت الماضي بين عشية وضحاها 1

لنفترض أن لديك جدولًا زمنيًا لتسجيل وقت عملك ، فالوقت في العمود A هو وقت بدء اليوم والوقت في العمود B هو وقت نهاية اليوم التالي. عادةً ، إذا قمت بحساب فرق الوقت بين المرتين عن طريق ناقص "= B2-A2" مباشرةً ، فلن يتم عرض النتيجة الصحيحة كما هو موضح في لقطة الشاشة اليسرى. كيف يمكنك حساب الساعات بين مرتين بعد منتصف الليل في Excel بشكل صحيح؟

احسب الساعات بين مرتين بعد منتصف الليل باستخدام الصيغة


السهم الأزرق الحق فقاعة احسب الساعات بين مرتين بعد منتصف الليل باستخدام الصيغة

للحصول على النتيجة المحسوبة الصحيحة بين مرتين خلال منتصف الليل ، يمكنك تطبيق الصيغة التالية:

1. أدخل هذه الصيغة: =(B2-A2+(B2<A2))*24 (A2 هو الوقت السابق ، B2 في وقت لاحق ، يمكنك تغييرها حسب حاجتك) إلى خلية فارغة بجانب بيانات الوقت ، انظر لقطة الشاشة:

doc حساب الوقت الماضي بين عشية وضحاها 2

2. ثم اسحب مقبض التعبئة إلى الخلايا التي تريد ملء هذه الصيغة ، وتم حساب الفروق الزمنية بين مرتين بعد منتصف الليل مرة واحدة ، انظر الصورة:

doc حساب الوقت الماضي بين عشية وضحاها 3

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

🤖 مساعد 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 (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