简体   繁体   中英

Excel time differenc minute calculation for difference rows

I need to log my hours for my job and I have an excel worksheet where the B column is the hour I started to work, the C column is the time I finished, and the D column is the total time I spent on working. I'd like the cells in the D column to automatically calculate the hours and minutes, and I have this formule =TEXT(C2-B2,"hh:mm") which works great for individual cells but I'd like the whole column to do that without me pasting it into every cell.

EDIT: To clarify, even if I would copy and paste it into every cell, I'd have to modify it to refer to the relevant row, I can't just write =TEXT(Cn-Bn,"hh:mm")

2ND EDIT: I found a solution on my own after some researching, I came up with this formula: =TEXT((INDIRECT("C"&ROW()))-(INDIRECT("B"&ROW())),"hh:mm") , I hope it'll help anyone who finds this post in the future

Once you have the row completed, you can select the columns and row that hold that initial data and under the home tab, click the Format as Table option. Once it is formatted as a table, the formula will be applied to any new rows. All you have to do is go to the next row (row 3) and type in your start and end times, Excel will do the rest.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM