修改 Excel 单元格以接受减去时间

Modify Excel cell to accept minus Time

如何修改 Excel 单元格以接受负时间,例如 (12:30- in the format hours:minutes) ,我想要这个以便插入员工每月超出预期的时间(例如 00:30+ 表示 7 月)或低​​于每月预期小时数(例如 01:33- 表示 6 月)。

我假设您要从另一个中减去一个 date/time。只需将单元格的格式设置为常规即可。一天 = 1。

=A3*24 给出小时数 +/-

=A3*24*60 给出分钟数 +/-

=A3*24*60*60 给你秒数 +/-

这有积极或消极的作用。

选项#1

你可以使用这个功能:

=IF(A1-A2<0,TEXT(ABS(A1-A2),"[hh]:mm-"),TEXT(A1-A2,"[hh]:mm"))

结果如下:

选项 #2

Microsoft says that you could do a switch to the 1904 Date System:

In Microsoft Office Excel 2003 and in earlier versions of Microsoft Excel, follow these steps:
1. Open, or switch to, the workbook.
2. On the Tools menu, click Options, and then click the Calculation tab.
3. Click to select the 1904 Date System check box.
4. Click OK.

In Microsoft Office Excel 2007, follow these steps:
1. Click the Microsoft Office Button, and then click Excel Options.
2. Click the Advanced category.
3. Under When calculating this workbook, click to select the Use 1904 date system check box, and then click OK.