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

使用公式从ID号计算年龄
<hr/>
<table>
<tbody>
<tr>
<td>
<div><strong>Calculate age based on birthday date:</strong></div>
<p><strong>Kutools for
Excel</strong> contains a powerful<strong> Formulas</strong> utility which collects some commonly used formulas can help you do some usual calculations quickly and easy, such as calculate age, add years, months, days to date, sum absolute values etc.</p>
<p>
<img src="https://zh-cn.extendoffice.com/images/stories/doc-excel/calculate-days-left-in-month/doc-calculate-age-01.png"/> </p>
<div>
<p><span><span><strong>Kutools for
Excel</strong>: with more than 200 handy
Excel add-ins, free to try with no limitation in 60 days.</span><span><strong>
<span><span> Download and free trial Now!</span> </span> </strong> </span> </span></p>
</div>
</td>
</tr>
</tbody>
</table>
使用公式从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编号中一次计算了年龄,请参见屏幕截图:

笔记:
1.在上式中 A2 是包含您要计算年龄的ID号的单元格。
2.使用上述公式,如果年份小于当前年份,则将其视为20;如果年份大于当前年份,则将其视为19。例如,如果今年为2016,则ID号 1209132310091的生日是 2012/09/13; 身份证号码 3902172309334的生日是 1939/02/17.
最佳办公生产力工具
使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。 单击此处获取您最需要的功能...

Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松
- 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
- 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
- 每天将您的工作效率提高50%,并减少数百次鼠标单击!
tset/如何从Excel中的ID号计算年龄?