跳到主要内容

如何从Excel中的ID号计算年龄?

假设您有一个ID号码列表,其中包含13位数字,而前6个数字是出生日期。 例如,ID号9808020181286表示生日是1998/08/02。 您如何从ID号中获取年龄,如以下在Excel中快速显示的屏幕截图所示?

文档ID 1的年龄

使用公式从ID号计算年龄


箭头蓝色右气泡 使用公式从ID号计算年龄

要根据ID号计算年龄,以下公式可以为您提供帮助。 请这样做:

输入以下公式:

=DATEDIF(DATE(IF(LEFT(A2,2)>TEXT(TODAY(),"YY"),"19"&LEFT(A2,2),"20"&LEFT(A2,2)),MID(A2,3,2),MID(A2,5,2)),TODAY(),"y") 到要计算年龄的空白单元格中,然后将填充手柄向下拖动到要应用此公式的单元格中,并且已经从ID编号中一次计算了年龄,请参见屏幕截图:

文档ID 2的年龄

笔记:

1.在上式中 A2 是包含您要计算年龄的ID号的单元格。

2.使用上述公式,如果年份小于当前年份,则将其视为20;如果年份大于当前年份,则将其视为19。例如,如果今年为2016,则ID号 1209132310091的生日是 2012/09/13; 身份证号码 3902172309334的生日是 1939/02/17.

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
What if the person in born in 1912? Surely you cant say 2012.
This comment was minimized by the moderator on the site
Hello, Mthembu

Yes, if the year in ID number is less that current year it will be considered as 20, if year is greater than current year will be considered as 19.
For example, this year is 2022, ID number 1009132310091’s birth date is 2010/09/13, the ID number 6802172309334’s birth date is 1968/02/17.

Thank you!
This comment was minimized by the moderator on the site
I also have the similar issue. Is there a way to distinguish between such scenario?
This comment was minimized by the moderator on the site
I think you are missing the point. If a person was born in 1920 (102 years old) , their ID would start with 20. A child born in 2020 (2 years old) will also start with 20. How do you determine now if the person is 102 or 2 years old by looking at the first 2 digits ?
This comment was minimized by the moderator on the site
Esta fórmula no funciona con Excel en español... Necesito la fórmula en español!! please
This comment was minimized by the moderator on the site
Cuál es la formula en español???
This comment was minimized by the moderator on the site
U are so cool. Can get two ic for we
This comment was minimized by the moderator on the site
very cool, works
This comment was minimized by the moderator on the site
mierda en españon
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations