简体   繁体   English

如何在Excel中的每个单元格中添加时间范围?

[英]How to add time ranges in each cell in Excel?

I have an Excel sheet that a manager updates manually with agent's work times, every week. 我有一张Excel工作表,经理每周都会手动更新代理的工作时间。 I want to be able to calculate the number of hours for all agents for each day. 我希望能够计算每天所有代理商的小时数。

The Excel sheet looks something like this: Excel工作表看起来像这样:

 +-----------+-------------+-------------+-------------+  
 |    NAME   |  MONDAY     |  TUESDAY    | WEDNESDAY   |  
 +-----------+-------------+-------------+-------------+  
 |   John    | 8:30 - 17:00| 8:30 - 17:00| 8:30 - 17:00|  
 +-----------+-------------+-------------+-------------+  
 |   Peter   | 8:00 - 16:30| 8:00 - 16:30| 8:00 - 16:30|  
 +-----------+-------------+-------------+-------------+  
 |   Craig   | 9:00 - 17:30| 9:00 - 17:30| 9:00 - 17:30|  
 +-----------+-------------+-------------+-------------+  
 |   TOTAL   |      8:30   |      8:30   |      8:30   |  
 +-----------+-------------+-------------+-------------+

Is this even possible? 这甚至可能吗? It would save a lot of time for a lot of people if it can be done. 如果可以的话,它会为很多人节省很多时间。

use SUMPRODUCT() with LEFT and RIGHT to parse the data: 使用LEFT和RIGHT的SUMPRODUCT()来解析数据:

=SUMPRODUCT(RIGHT(TRIM(B2:B4),5)-LEFT(TRIM(B2:B4),5))

You will need to use a custom format on the output of [hh]:mm 您需要在[hh]:mm的输出上使用自定义格式

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 对于每个具有不同范围的单元格? - For each cell with different ranges? 如何在excel中的日期单元格的每个值周围添加引号? - How to add quotes around a each value of a cell of dates in excel? 如何将其他单元格区域添加到worksheet_change代码以一次评估一个区域? - How do I add other cell ranges to a worksheet_change code to evaluate one range at a time? 如何在Excel中创建时间范围图 - How to create graph of time ranges in Excel 如何在Excel文档中为单元格范围添加当前时间 - How to add current time in an excel document for range of cell 如何在 VBA Excel 中添加将当前日期和时间添加到单元格的按钮? - How to add button that adds current date and time to the cell in VBA Excel? Python Excel:如何向现有 excel 文件中的每个单元格添加一个数字,然后将新值发送回 excel 文件,然后将新值发送回 excel 文件,然后将新值发送回 excel 文件,然后将新值发送回 excel 文件 - Python Excel: how to add a number to each cell in an existing excel file and then send the new value back to excel document Excel - 将单元格值插入范围 - Excel - Inserting Cell Values into Ranges Excel VBA:如何从单元格中的公式访问(参考)范围 - Excel VBA : How to access (Referenced) Ranges from Formula in a Cell Excel-如何跨多个单元格区域应用过滤器 - Excel - How to apply a filter accross multiple cell ranges
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM