excel中datedif函数的运用方法
时间:2022-10-15 13:19:59
DATEDIF函数是一个excel中隐藏的、但功能非常强大的日期函数,主要用于计算两个日期之间的天数、月数或年数。今天,小编就教大家在Excel中datedif函数的运用方法。
在Excel中datedif函数的运用方法如下:
函数语法:
DATEDIF(start_date,end_date,unit)。
参数1:start_date,表示起始日期。
参数2:end_date,表示结束日期。
参数1和参数2可以是带引号的文本串(例如:"2014-1-1")、系列号或者其他公式或函数的结果。
参数3:unit为所需信息的返回时间单位代码。各代码含义如下:
"y"返回时间段中的整年数。
"m”返回时间段中的整月数。
"d"返回时间段中的天数。
"md”参数1和2的天数之差,忽略年和月。
"ym“参数1和2的月数之差,忽略年和日。
"yd”参数1和2的天数之差,忽略年。按照月、日计算天数。
1、利用DATEDIF计算相差天数。
C2单元格计算2个日期间的实际天数。
=DATEDIF(A2,B2,"d")
D2单元格按照忽略年份来计算天数。
=DATEDIF(A2,B2,"yd")
E2单元格按照忽略年份与月份计算相差天数。
=DATEDIF(A2,B2,"md")
2、利用DATEDIF函数计算周岁。
在E5单元格输入公式:
=DATEDIF(DATE(LEFT(C5,4),MID(C5,5,2),RIGHT(C5,2)),TODAY(),"y")&"周岁",
说明:date函数用于将文本表示的出生日期转换为真正的出生年月日。
标签:函数,参数,天数,计算,Excel函数
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
wps冻结列怎么设置
2022-07-04 23:56:41
Win8.1系统玩战地4提示DirectX Error错误怎么解决
2022-02-09 15:30:51
![](https://img.aspxhome.com/file/2023/2/a284631_0s.jpg)
Win7系统金山打字游戏提示无法初始化音效引擎怎么办
2023-08-26 01:31:17
![](https://img.aspxhome.com/file/2023/3/a292145_0s.jpg)
如何在Mac和 iPad上使用通用控制?Mac和iPad使用通用控制系统要求与方法
2022-05-16 21:34:40
![](https://img.aspxhome.com/file/2023/3/a214413_0s.jpg)
如何将数据和应用程序移至新 iPad?
2022-06-01 09:23:19
![](https://img.aspxhome.com/file/2023/0/a206270_0s.jpeg)
程序兼容助手服务怎么关闭?Win10禁用程序兼容助手服务的方法
2023-08-07 08:20:10
![](https://img.aspxhome.com/file/2023/26/a225632_0s.jpg)
wps演示怎么裁剪图片
2022-12-13 13:19:15
i5cpu天梯图_2020年i5cpu天梯图最新高清大图
2023-02-22 08:58:52
![](https://img.aspxhome.com/file/2023/4/a305997_0s.jpg)
Excel获取非空单元格
2023-10-24 17:26:46
![](https://img.aspxhome.com/file/2023/6/a141866_0s.png)
如何破解邮箱密码的解决方法
2023-06-03 20:15:42
![](https://img.aspxhome.com/file/2023/3/a298997_0s.jpg)
Win10网络被限速了怎么解决
2022-09-07 07:43:39
![](https://img.aspxhome.com/file/2023/26/a221125_0s.png)
圣诞老人到哪了?Win10地图定位追踪锁定目标
2023-06-11 09:22:15
![](https://img.aspxhome.com/file/2023/28/a246049_0s.png)
Excel中设置员工生日提醒的方法
2023-12-16 14:47:36
![](https://img.aspxhome.com/file/2023/5/a140105_0s.png)
Word文档怎么制作思维导图
2023-02-15 22:11:54
![](https://img.aspxhome.com/file/2023/9/31819_0s.png)
腾讯会员最多可以几个人一起登录?
2023-12-16 03:43:11
![](https://img.aspxhome.com/file/2023/6/a323538_0s.jpg)
Tuneskit Audio Capture for Mac在Mac OSX上如何捕获和提取任何声音
2022-09-11 18:30:43
![](https://img.aspxhome.com/file/2023/0/a212700_0s.jpeg)
wps表格如何设置页眉页脚图文教程
2022-04-24 05:55:17
PS怎么加粗线条?
2023-01-11 11:14:30
![](https://img.aspxhome.com/file/2023/9/a341662_0s.png)
台式电脑没有没有声音了怎么恢复?
2022-10-03 00:26:39
![](https://img.aspxhome.com/file/2023/6/a321636_0s.png)
win7系统关闭U盘自动运行有妙招
2022-03-08 07:54:01
![](https://img.aspxhome.com/file/2023/5/a314057_0s.png)