iT邦幫忙

0

Excel formula 救教

各位大大

我有一個excel formula 怎樣想也想不到
我要幫工司做一個excel 表格給加班的同事報加班費,因同事需要零晨工作,所以我的表格怎樣也寫不到正確的formula

假如工作時間由下午三時開始,工時為九小時,正常應該是零晨12時下班,但因加班要零晨三時才下班,我應該怎可將F 寫成formula ,同時只需輸入IN and OUT time 就可自動計算加班時數

IN time - 15:00
Out time - 03:00
Overtime working 3 hrs

slime iT邦大師 1 級 ‧ 2019-05-27 17:03:55 檢舉
1. 土法煉鋼: 兩個上班時段: 1500~2359, 0000~0300
2. 如果 Out < In , 就拆 1500~2359, 0000~0300 , 分別計算時間再相加.
3. 如果能 Out 跟 In 加上 Date 判斷更好.
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
Denny Chang
iT邦新手 2 級 ‧ 2019-05-27 17:38:47

我的想法是先把總工時算出來,再跟9小時比較,算出over time working。
公式:
總工時: =IF(B2>A2,B2-A2,B2+1-A2)
over time working: =IF(D2>$E$1,D2-$E$1,0)https://ithelp.ithome.com.tw/upload/images/20190527/20116986sTF04rzLP8.png
你再試試看~

zoewong iT邦新手 5 級 ‧ 2019-05-28 18:19:55 檢舉

Denny大大, 謝謝你, 我根據你的formula試了好幾次, 還是做不好, 到底是那一個步驟出錯了呢 ?

https://ithelp.ithome.com.tw/upload/images/20190528/20117935YiJuShHRqQ.pnghttps://ithelp.ithome.com.tw/upload/images/20190528/201179357XgbYv2ScD.pnghttps://ithelp.ithome.com.tw/upload/images/20190528/20117935XxTcYA2Sr5.png

zoewong iT邦新手 5 級 ‧ 2019-05-28 18:21:28 檢舉

https://ithelp.ithome.com.tw/upload/images/20190528/20117935PTcbLhsGsc.png

您好,問題來自G欄的公式前半部沒改到 =IF(D2>$E$1,D2-$E$1,0)
改成=IF(F3>E3,F3-E3,0),你再試試看~

我要發表回答

立即登入回答