DATEDIF函数怎么精确计算账龄?
时间:2023-07-02 00:22:08
DATEDIF函数怎么精确计算账龄?计算出的账龄是以”6个月内”,”6-12个月”,”1-2年”,”超过2年”四个时间段来表示的,今天有朋友问,如果想精确到年月天数的账龄,怎么算?
如下图:
公式实现
输入公式:
=DATEDIF(B2,C2,”Y”)&”年”&DATEDIF(B2,C2,”YM”)&”个月”&DATEDIF(B2,C2,”MD”)&”天”
确定并向下填充,即可得所有费用的精确账龄。
如下图:
DATEDIF函数解析
DATEDIF函数,用于计算两个日期之间的天数、月数或年数。
具体用法:
语法:
DATEDIF(start_date,end_date,unit);
中文语法:
DATEDIF(起始日期,结束日期,时间代码);
参数1:start_date,表示起始日期;
参数2:end_date,表示结束日期;
参数3:unit为所需信息的返回时间单位代码。各代码含义如下:
“y”返回时间段中的整年数
“m”返回时间段中的整月数
“d”返回时间段中的天数
“md”参数1和2的天数之差,忽略年和月
“ym“参数1和2的月数之差,忽略年和日
“yd”参数1和2的天数之差,忽略年。按照月、日计算天数。
例:
标签:Excel函数,excel函数公式,excel教程,WPS
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win10家庭版如何彻底关闭Windows defender?
2022-11-30 16:29:36
![](https://img.aspxhome.com/file/2023/26/a219184_0s.jpg)
如何在wps表格中拆分冻结窗口
2023-01-11 01:17:39
电脑还能安装Win7系统吗?电脑怎么重新安装Win7系统?
2022-06-09 00:28:59
![](https://img.aspxhome.com/file/2023/26/a227894_0s.png)
WPS表格文字格式的正确输入法
2022-03-22 07:12:37
![](https://img.aspxhome.com/file/2023/0/a164700_0s.jpg)
Win7电脑显示器闪屏怎么办?电脑显示器出现闪屏解决方法
2022-10-07 20:47:54
![](https://img.aspxhome.com/file/2023/26/a228387_0s.png)
Win10专业版怎么禁止电脑自动更新?
2023-09-25 18:45:07
![](https://img.aspxhome.com/file/2023/26/a222812_0s.jpg)
Win10使用无线同屏功能的操作教程
2023-08-26 05:57:52
![](https://img.aspxhome.com/file/2023/1/a279221_0s.jpg)
微云网盘资料怎么直接转移到百度云网盘
2023-12-17 05:25:02
![](https://img.aspxhome.com/file/2023/4/a310117_0s.jpg)
excel怎么在散点图上加一条水平线
2022-02-07 11:54:23
![](https://img.aspxhome.com/file/2023/1/a140521_0s.png)
Excel 删除趋势线的2种方法
2023-01-19 13:07:44
![](https://img.aspxhome.com/file/2023/6/a154116_0s.jpg)
win11无法共享打印机的三种解决方法
2023-10-02 21:14:45
![](https://img.aspxhome.com/file/2023/30/a267544_0s.jpg)
win10excel打不开的解决方法
2022-11-27 15:50:39
windows7系统程序响应时间慢要怎么办
2023-06-29 02:39:46
格式工厂如何调整分辨率?
2022-05-11 05:38:04
![](https://img.aspxhome.com/file/2023/30/a267357_0s.jpg)
深挖核心词库容量 QQ输入法引领Mac输入新体验
2022-09-12 09:37:34
![](https://img.aspxhome.com/file/2023/5/a318505_0s.png)
在Mac OS X中快速安装TEX的一种新的方法
2023-06-26 12:00:12
![](https://img.aspxhome.com/file/2023/0/a215380_0s.jpg)
Win11复选框无法关闭怎么办?Win11文件夹复选框关闭方法
2022-10-19 17:41:42
![](https://img.aspxhome.com/file/2023/27/a236631_0s.jpg)
Win10如何扫描修复磁盘驱动器错误?
2022-10-08 09:36:15
![](https://img.aspxhome.com/file/2023/26/a224681_0s.jpg)
在windows8中查看和评估系统分级的方法
2022-06-19 23:15:44
![](https://img.aspxhome.com/file/2023/29/a256837_0s.jpg)
Win10系统如何关闭自动更新功能的三大技巧
2023-10-10 23:22:02
![](https://img.aspxhome.com/file/2023/2/a285693_0s.jpg)