在excel表格中计算时间差

来源:互联网/编辑:阳光手游网/更新时间:2023-05-03 23:29:13

在手机上看

扫一扫进入手机端

excel表格中计算时间差

如何在excel中计算日期的天数或时差。对于日期和时间之间的差异,例如日期时间差异公式,结果是小时(例如134.5小时)。例如,从2016年2月10日13:26到2016年3月6日10:40之间有多少小时?我们怎么能做到?

rú如 hé何 zài在 e x c e l zhōng中 jì计 suàn算 rì日 qī期 de的 tiān天 shù数 huò或 shí时 chā差 。 duì对 yú于 rì日 qī期 hé和 shí时 jiān间 zhī之 jiān间 de的 chā差 yì异 , lì例 rú如 rì日 qī期 shí时 jiān间 chā差 yì异 gōng公 shì式 , jié结 guǒ果 shì是 xiǎo小 shí时 ( lì例 rú如 1 3 4 . 5 xiǎo小 shí时 ) 。 lì例 rú如 , cóng从 2 0 1 6 nián年 2 yuè月 1 0 rì日 1 3 : 2 6 dào到 2 0 1 6 nián年 3 yuè月 6 rì日 1 0 : 4 0 zhī之 jiān间 yǒu有 duō多 shǎo少 xiǎo小 shí时 ? wǒ我 men们 zěn怎 me么 néng能 zuò做 dào到 ?

First of all, the number of days between these two dates needs to be calculated separately. We can get the results we need by calculating the number of days between the two software.

首先,这两个日期之间的天数需要单独计算。我们可以通过计算两个软件之间的天数来得到我们需要的结果。

很简单。我们可以直接减去这两个日期之间的天数,如下图所示:

hěn很 jiǎn简 dān单 。 wǒ我 men们 kě可 yǐ以 zhí直 jiē接 jiǎn减 qù去 zhè这 liǎng两 gè个 rì日 qī期 zhī之 jiān间 de的 tiān天 shù数 , rú如 xià下 tú图 suǒ所 shì示 :

excel表格

在excel表格中计算时间差  图1
 

We can also use the hidden function datedif function, input: = datedif (A2, B2, "d")

我们还可以使用隐藏函数datedif function,input:=datedif(a2,b2,“d”)

wǒ我 men们 hái还 kě可 yǐ以 shǐ使 yòng用 yǐn隐 cáng藏 hán函 shù数 d a t e d i f f u n c t i o n , i n p u t : = d a t e d i f ( a 2 , b 2 , “ d ” )

The syntax of this function is as follows: = datedif (start date, end date, third parameter). The third parameter can be in several cases, returning the days, months, and years of the interval. As shown in the figure:

此函数的语法如下:=datedif(开始日期、结束日期、第三个参数)。第三个参数可以是在几种情况下,返回间隔的天、月和年。如图所示:

cǐ此 hán函 shù数 de的 yǔ语 fǎ法 rú如 xià下 : = d a t e d i f ( kāi开 shǐ始 rì日 qī期 、 jié结 shù束 rì日 qī期 、 dì第 sān三 gè个 cān参 shù数 ) 。 dì第 sān三 gè个 cān参 shù数 kě可 yǐ以 shì是 zài在 jǐ几 zhǒng种 qíng情 kuàng况 xià下 , fǎn返 huí回 jiàn间 gé隔 de的 tiān天 、 yuè月 hé和 nián年 。 rú如 tú图 suǒ所 shì示 :


excel表格

The results to display include days, such as 8 days. This can be achieved by adding & "day", = datedif (A13, B13, "d") and "day" after the above formula.

excel表格中计算时间差  图2

要显示的结果包括天,例如8天。这可以通过在上述公式之后添加&“day”、=datedif(a13,b13,“d”)和“天”来实现。

yào要 xiǎn显 shì示 de的 jié结 guǒ果 bāo包 kuò括 tiān天 , lì例 rú如 8 tiān天 。 zhè这 kě可 yǐ以 tōng通 guò过 zài在 shàng上 shù述 gōng公 shì式 zhī之 hòu后 tiān添 jiā加 & “ d a y ” 、 = d a t e d i f ( a 1 3 , b 1 3 , “ d ” ) hé和 “ d a y ” lái来 shí实 xiàn现 。

Then, how to calculate the difference between two time periods separately within the document. How to achieve it? As shown in the figure:

然后,如何在文档中分别计算两个时段之间的差异。如何实现?如图所示:

rán然 hòu后 , rú如 hé何 zài在 wén文 dàng档 zhōng中 fēn分 bié别 jì计 suàn算 liǎng两 gè个 shí时 duàn段 zhī之 jiān间 de的 chā差 yì异 。 rú如 hé何 shí实 xiàn现 ? rú如 tú图 suǒ所 shì示 :


excel表格

In the case of date and time, how many hours are different? For example, what is the distance between 13:26 on February 10, 2016 and 10:40 on March 6, 2016? How can it be achieved?

excel表格中计算时间差  图3

在日期和时间的情况下,有多少小时是不同的?例如,2016年2月10日13:26到2016年3月6日10:40之间的距离是多少?如何实现?

Input = (b1-a1) * 24, realizable

输入=(b1-a1)*24,可实现

Input = text (b1-a1, "[H]: mm") * 24, which can also be realized. Function text is used to transform the time format.

输入=文本(b1-a1,“[h]:mm”)*24,也可以实现。函数文本用于转换时间格式。

shū输 rù入 = wén文 běn本 ( b 1 - a 1 , “ [ h ] : m m ” ) * 2 4 , yě也 kě可 yǐ以 shí实 xiàn现 。 hán函 shù数 wén文 běn本 yòng用 yú于 zhuǎn转 huàn换 shí时 jiān间 gé格 shì式 。


excel表格

How to add "hour" display in the text, for example: 8 hours, such a display effect. This can be achieved by adding the following after the above formula: & "hour", see the above operation steps

在excel表格中计算时间差  图4

如何在文本中添加“小时”显示,例如:8小时,这样的显示效果。这可以通过在上述公式之后添加以下内容来实现:&“小时”,请参见上述操作步骤

In order to save several decimal places, "2" in the above formula means to keep two decimal places.

为了节省几个小数位,上面公式中的“2”表示保留两个小数位。 数字表示要舍入的值或单元格内容。号码?数字表示需要多少参数。

The following is an introduction of a relatively simple Excel to calculate the time difference through the function. The input process of the function will be a little cumbersome, but learn how to operate it.

下面介绍了相对简单的excel通过函数计算时差。函数的输入过程会有点麻烦,但是要学会如何操作它。可以让我们在生活中以及在学习中能够轻松不少,希望能够给大家带来帮助。

 

Through learning and consulting, the above methods are summed up, which may be a little wordy. In any case, the methods and thinking are right. You have to do it in detail. Find more and more convenient ways.

热门新闻

精彩专题

更多+

游戏排行

安卓 苹果

最新开测

阳光手游网 www.ygkfpay.com 版权所有

温馨提示:适度游戏娱乐,沉迷游戏伤身,合理安排时间,享受健康生活

我们用心在做,阳光手游网为您提供更多好玩的 手机游戏排行榜 手机游戏下载 苹果手机游戏 安卓手机游戏 好玩的游戏 好玩的手机游戏 好玩的手机网游