Excel身份证号码计算年龄公式:Excel函数不求人
时间:2022-02-10 15:21:25
在之前关于电子表格身份证号码的文章中,我已经解释了如何使用电子表格身份证号码来获得诸如出生日期和性别判断的函数公式。今天,我们将继续我们关于电子表格身份证号码的专题。解释使用身份证号来计算年龄,当然,这个年龄是根据系统的当前时间来计算的,或者可以自定义指定的时间来计算。这里,我提供了四种不同的公式方法来实现它。
方法1:根据当前系统日期计算
在B2单元格中,输入公式:[=datedif(文本(mid (a2,7,8),’ #-00-00 ‘),today(),’ y’)]
DATEDIF:计算机数据比较功能;
文本:将数值转换为以指定数字格式表示的文本;
中间:剪切指定数量的字符;
TODAY:用于返回当前时间;
y:指计算两个日期之间的年差;
第二种方法也基于当前系统日期
输入公式:[=datedif(文本((len (a2)=15) * 19mid (a2,7,6 (len (a2)=18) * 2),’ #-00-00 ‘),today(),’ y’)]。你也可以用同样的方法计算年龄。
方法3:计算确切的年龄
这种方法是计算确切的年龄,精确到年、月、日和日。这个公式有点长。
公式:[=datedif(-text((len(a2)=15)* 19 mid(a2,7,6 (len (a2)=18) * 2),’ 0-00-00 ‘),today(),’ y ‘),’一岁零’ 0-00-00 ‘,’ TODAY(),’ ym ‘)’ month ‘ datedif(-text((len(a2)=15)* 19 mid(a2,7,6 (len (a2)=18) * 2),’ 0-00
方法4:根据指定日期计算年龄
上述方法根据当前时间计算年龄。第四种方法基于指定日期计算年龄。例如,我想计算身份证号码上的年龄,直到2010年1月1日。我应该输入什么公式?
输入公式:[=datedif(文本(mid (a2,7,6 (len (a2)=18) * 2),’ #-00-00′) * 1,’ 2010-01-01 ‘,’ y’)]
如果您想自定义您的指定日期,您可以在下面的公式中自由修改[2010-01-01]。
好了,这个方法已经交给每个人了,所以你可以用你的手来试试效果!
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
word2010表格怎么平均分配各行?
![](https://img.aspxhome.com/file/2023/1/24421_0s.png)
2021.9月最新Microsoft 365密钥推荐 附激活工具+教程
excel坐标轴刻度不均匀怎么设置
![](https://img.aspxhome.com/file/2023/3/a141343_0s.png)
怎样把cad图形插入Word文档
在Word2010文档中如何设置艺术字柔化边缘效果
![](https://img.aspxhome.com/file/2023/2/29562_0s.jpg)
Word怎么取消自动生成图片
![](https://img.aspxhome.com/file/2023/5/31925_0s.png)
Excel 数据库函数条件区域怎样设置
![](https://img.aspxhome.com/file/2023/2/36072_0s.jpg)
excel时间加减函数怎么用?
![](https://img.aspxhome.com/file/2023/1/40961_0s.jpg)
Win10 20H2值得更新吗?详细解析Win10系统20H2值得更新吗
![](https://img.aspxhome.com/file/2023/8/51358_0s.png)
金山wps诗歌文字怎么排成扇形
![](https://img.aspxhome.com/file/2023/2/a163912_0s.jpg)
Win10专业版无internet安全怎么办?
![](https://img.aspxhome.com/file/2023/0/50720_0s.png)
Word2010页面背景怎么设置
![](https://img.aspxhome.com/file/2023/0/19620_0s.jpg)
Excel宏的使用图文教程
![](https://img.aspxhome.com/file/2023/9/43189_0s.jpg)
excel 聚光灯效果 如何实现?
![](https://img.aspxhome.com/file/2023/2/a140922_0s.jpg)
Excel表格数字转换成文本详细图文步骤
![](https://img.aspxhome.com/file/2023/8/43318_0s.jpg)
word文档怎么打勾 word文档方框内打勾六种方法介绍
![](https://img.aspxhome.com/file/2023/1/29231_0s.png)
如何打开不同格式的Word文档
![](https://img.aspxhome.com/file/2023/0/19830_0s.jpg)
word近义词功能如何使用
![](https://img.aspxhome.com/file/2023/0/35840_0s.jpg)
在Word2003页眉或页脚中插入文档名称和路径
![](https://img.aspxhome.com/file/2023/0/30550_0s.jpg)
Excel2007表中如何快速查找特定行列交叉单元格
![](https://img.aspxhome.com/file/2023/1/37951_0s.jpg)