简体   繁体   中英

Excel Summing Function For Blank Cells To Relate to Filled Cell

I am developing a spreadsheet for construction work that list the amount of employees per day on a particular job. I need to sum the row to figure out the total amount of daily per diem charge to give them. (Per diem is basically a pay charge to the employee to pay for their hotel when working out of town). This needs to be paid even on days they do not work. So I have a formula that if a blank cell is found, (blank meaning no employee/s working that day), then add the day before employee count instead.

The problem that i need to solve is, what if the employee/s are off for 2-3 days instead, then how will I generate a formula to figure the last filled cell into the blank cells. For example in the picture tagged, I have row 12 with the first week having 1 employee on the job, then second week 2 employees. The 1 employee on the first week should be receiving per-diem for Saturday and Sunday, but my formula is only figuring one of the off days and summing that instead of both. How can I get it to sum both off days for the manpower that is given before the off days happen. Off days can range from 1-3 concurrent days and is not always 2 days off.

See image bellow of my current spreadsheet which equals "1" currently but should equal "2" and for line 13 equals "4 currently but should equal "8" since two days are off:

当前公式和表格

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