在本文中,我们将学习如何在Excel中使用days函数。

用简单的话来说,DAYS函数返回两个日期之间的天数,而excel DAYS函数获取一个数字,它是两个给定日期之间的天数。

语法:

=DAYS (end_date, start_date)

Start_date:从日期End_date:到日期让我们以示例为例来了解此功能。

58

使用公式。

B2 : end_date

A2 : start_date



You can see the formula returns a number, the total days elapsed between the two dates. Now copy the formula to other cells using shortcut key Ctrl + D.



Use the above function formulas to get the days between dates in Excel. Alternate method Excel stores dates as numbers, a simple mathematical formulation explained. So just need to subtract the two dates it will get the days between the two dates.

<div="bbbb">=later_date - earlier date

=IF(date1>date2, date1 - date2, date2 - date1)

如果您不知道将日期放在第一位,请使用以下公式。

让我们以一个例子来了解这个功能。

61

在C2和D2单元格中使用公式。

=A2-B2

62

如果date1 <date2,此公式将为您带来负面结果。

如果您不想关心哪个较小,只需在剩余单元格中使用以下公式

=IF(A4>B4, A4-B4, B4-A4)

63

使用上面的函数公式在Excel中获取日期之间的日期希望您了解如何在Excel中使用DAYS函数获取日期之间的日期。在此处浏览有关Excel日期和时间函数的更多文章。请随时声明您对以上文章的查询或反馈。

热门文章:

热门文章:

50 Excel快捷方式以提高生产率链接:/ excel日期和时间使用-the-now-function-excel [如何在Excel中使用VLOOKUP函数]