excel表格计算年龄

Can you remember how old you are? Or are you like me, and have to ask, "What year is it?" and then subtract your birth year? Or do you like calculating ages in Excel -- let it do the arithmetic for you!

你还记得你几岁吗? 还是您像我一样,不得不问:“这是哪一年?” 然后减去你的出生年份? 还是您喜欢在Excel中计算年龄-让它为您做算术!

Excel DATEDIF函数 (Excel DATEDIF Function)

Fortunately, calculating ages in Excel is easy, if you use the handy, but poorly documented, DATEDIF function.

幸运的是,如果使用方便的但记录不充分的DATEDIF函数,则在Excel中计算年龄很容易。

You won't find DATEDIF in Excel's help, and the Microsoft website suggests a different method of calculating date differences. If anyone knows why, I'd love to hear about it.

在Excel的帮助中找不到DATEDIF,Microsoft网站建议使用另一种计算日期差异的方法。 如果有人知道为什么,我很想听听。

UPDATE and WARNING: In some versions of Excel, there is a bug in the DATEDIF function for some intervals. For details, see the article ktDATEDIF Function, which suggests a user defined function as an alternative. (Thanks to Sam and Rick for their comments below.)

更新和警告 :在某些版本的Excel中, DATEDIF函数中存在一段时间的错误 。 有关详细信息,请参见文章ktDATEDIF Function ,它建议使用用户定义的函数作为替代。 (感谢Sam和Rick在下面的评论。)

创建日期列表 (Create a List of Dates)

It was my son's birthday last weekend, and he was complaining about getting old. Geez, if he's old, what does that make me? (Please don't answer!)

这是我儿子上周末的生日,他一直在抱怨变老。 哎呀,如果他老了,那对我有什么影响? (请不要回答!)

To keep track of family birthdays and ages, you can create a list in Excel. In one column, enter everyone's birth date. Here's an example, with birth dates created using the RANDBETWEEN function.

为了跟踪家庭的生日和年龄,您可以在Excel中创建一个列表。 在一个栏中,输入每个人的生日。 这是一个示例,其中使用RANDBETWEEN函数创建了出生日期。

=RANDBETWEEN($F$2,$G$2)

= RANDBETWEEN($ F $ 2,$ G $ 2)

使用DATEDIF函数 (Using the DATEDIF Function)

To calculate each person's current age, you can use the DATEDIF function, to compare their birth date with today's date. The DATEDIF has 3 arguments:

要计算每个人的当前年龄,可以使用DATEDIF函数将其生日与今天的日期进行比较。 DATEDIF具有3个参数:

=DATEDIF(Date1, Date2, Interval)

= DATEDIF(日期1,日期2,间隔)

Date1 must be earlier than Date2, or the result will be a #NUM! error. Interval is the unit of time that you want to show the results in, such as:

Date1必须早于Date2,否则结果将为#NUM! 错误。 时间间隔是您想要显示结果的时间单位,例如:

  • y for yearsy年
  • m for months数月
  • yd for calendar days between dates, ignoring the yearsyd表示日期之间的日历天,忽略年份

For example, to find the current age, in years, for the birth date in cell B2, enter this formula in cell C2:

例如,要在单元格B2中查找出生日期的当前年龄(以年为单位),请在单元格C2中输入以下公式:

=DATEDIF(B2,TODAY(),"y")

= DATEDIF(B2,TODAY(),“ y”)

更改间隔 (Change the Interval)

To see a person's age in months, you can use "m" as the interval, instead of "y".

要查看某人的年龄(以月为单位),可以使用“ m”作为间隔,而不是“ y”。

=DATEDIF(B3,TODAY(),"m")

= DATEDIF(B3,TODAY(),“ m”)

DATEDIF的问题 (Problems With DATEDIF)

Thanks to Sam and Rick, who commented below. They pointed out that Excel 2007 and Excel 2003 may give incorrect results in some situations, especially for the "yd" and "md" intervals.

感谢Sam和Rick,他们在下面发表了评论。 他们指出, 在某些情况下 ,尤其是对于“ yd”和“ md”间隔,Excel 2007和Excel 2003可能会给出错误的结果

You should use the more reliable user defined ktDATEDIF Function to calculate these date differences, or use Microsoft's suggested formula for calculating date differences.

您应该使用更可靠的用户定义的ktDATEDIF函数来计算这些日期差,或者使用Microsoft建议的公式来计算日期差 。

更多DATEDIF信息 (More DATEDIF Information)

Chip Pearson has more information on the DATEDIF function, which he describes as "treated as the drunk cousin of the Formula family." He shows several examples of using DATEDIF, and explains how to use it with leap years.

Chip Pearson拥有有关DATEDIF功能的更多信息,他将其描述为“被视为Formula家族的堂兄”。 他展示了几个使用DATEDIF的示例,并解释了如何在leap年使用它。

Microsoft has DATEDIF details for SharePoint, which looks the same as the missing DATEDIF info for Excel.

Microsoft具有SharePoint的DATEDIF详细信息,与Excel缺少的DATEDIF信息相同。

DATEDIFF功能 (DATEDIFF Function)

And finally, don't confuse the Excel worksheet function, DATEDIF, with the VBA function DATEDIFF, or the Access DATEDIFF function.

最后,不要将Excel工作表函数DATEDIF与VBA函数DATEDIFF或Access DATEDIFF函数混淆。

Although the functions have similar results, the DATEDIFF functions have different arguments, and use different interval settings. For example, "yyyy" is the setting for year, instead of "y". ________________

尽管函数具有相似的结果,但DATEDIFF函数具有不同的参数,并使用不同的间隔设置。 例如,“ yyyy”是年份的设置,而不是“ y”。 ________________

翻译自: https://contexturesblog.com/archives/2010/02/01/calculating-ages-in-excel/

excel表格计算年龄


http://www.taodudu.cc/news/show-4219234.html

相关文章:

  • mysql中日期相减_解放双手!用这3个日期函数解决入职、工龄等天数的计算
  • 请假工资扣费总额计算机公式,病假扣款计算公式excel
  • 计算机作业怎么算工龄,EXCEL如何根据输入的入职日期自动计算工龄
  • 单词记忆(3)
  • [9i] 猪年说猪,属相,本命年,十二生肖用英语该怎么说
  • English Pod 听力学习之路 C41 - C68
  • 内网环境下使用rpm包制作yum数据源及使用
  • 垂钓之王hd_它的专业人士指南,以阻止网络钓鱼
  • angularjs常见错误_AngularJS开发人员应避免的7大错误
  • excel加水印,由于excel没有加水印功能,实际上操作是将图片丢进去
  • python if多个条件并列_Python中if有多个条件处理方法
  • pythonif多个条件同时满足_Python基础:条件控制if
  • c 语言多个if并联使用,if的嵌套和多个并列if的效率有关问题
  • c#语言中if语句多条件,关于C# if语句中并列条件的执行
  • php if多条件,php – 多个IF语句条件
  • java if或_java中if条件语句里条件的并列
  • if函数多个条件php,excelif函数的多个条件使用方法
  • python if多个条件并列_Python if有多个条件怎么办
  • HTML函数多个条件并列,excel if函数如何多个条件并列
  • 【python环境下Z3约束求解器学习笔记】And和Or的用法
  • C语言链表的删除代码实现
  • 计算机技术在建筑学的应用论文,计算机应用于建筑设计中的影响的论文
  • 车载激光扫描系统介绍
  • 应用与计算机病毒,计算机病毒论文
  • 地理信息技术类毕业论文文献有哪些?
  • 谷歌Cartographer的论文研读(一)
  • 计算机三维制图论文,三维重建初探(整理的一些资料及论文分享)
  • IROS2020 论文阅读
  • 计算机技术与应用论文,计算机应用技术论文
  • 怎么确定电脑上没有mysql_怎么检查电脑有没有mysql?

excel表格计算年龄_在Excel中计算年龄相关推荐

  1. excel表格数字显示不全_从word中把身份证号码复制到excel表格中完整显示身份证号码后4位...

    ​ 如果直接从word中复制内容,在excel表格中进行粘贴处理,gif动画演示如下: 在word中,身份证号显示是完整的,而直接复制到excel表格会显示成E*17,这是科学计数法.双击单元格显示出 ...

  2. python 跳过计算错误_在python中计算分数时如何跳过被0除的错误?

    我正在运行一个很长的CSV文件下面的函数.函数每50行计算列MFE的Z分数.这50行中有一些只包含零,因此在计算Zscore时,程序会停止,因为它不能被零除.如何解决这个问题,而不是停止程序运行打印这 ...

  3. mysql怎么计算幂_在MySQL中计算数字的幂?

    要计算数字的幂,请使用POWER()函数.让我们首先创建一个表-create table DemoTable ( Amount int ); 使用插入命令在表中插入一些记录-insert into D ...

  4. python计算协方差_在Python中计算协方差

    要计算协方差,您需要类似下面这样的内容,它有一个嵌套循环,遍历每个列表,并使用协方差公式累积协方差.在# let's get the mean of `X` (add all the vals in ...

  5. 如何将EXCEL表格的内容导入到CDR中?

    CDR中能做表格?答案是肯定的,而且方法不止一种,比如利用图纸工具或者表格工具.现在教大家一个更快捷.简单的方法,将Excel表格直接导入到CDR软件,立刻完成你的表格绘制,而且还可以导入内容,并且能 ...

  6. php使用excel表格数据库数据,php使用excel表格数据库数据库-php中如何将execl的数据导入到数据库中...

    php中如何将execl的数据导入到数据库中 1.使用PHP Excel Parser Pro软件,但是这件为收费软件: 2.可将EXCEL表保CSV,然后通过 phpmyadmin 或者SQLyog ...

  7. excel 查询 表关联_从Excel查询表获取里程

    excel 查询 表关联 There is a new sample file on my website, in response to a lookup question that someone ...

  8. java使用jxl生成excel表格,jsp使用js下载excel文件xls

    java使用jxl生成excel表格,jsp使用js下载excel文件 后端代码 maven jar包 主体代码逻辑 引入的jar包 具体代码段 重点详解 表头和表格内容两种格式 直接将 HttpSe ...

  9. php页面导入excel表格,php页面导入excel表格数据:php导入excel 怎么获取excel表格数据...

    导入excel文件,后端php处理导入的数据并存入数据库,需要前后端结合的demo! thinkphp3.2phpexcel导入最基本用法 先整个最基础的代码,理解了这个,后面非常简单了 $file_ ...

  10. excel导入数据校验_使用Excel数据验证限制日期范围

    excel导入数据校验 Yesterday, one of my clients emailed to let me know that she was having trouble entering ...

最新文章

  1. 编程之美-高效率安排见面会的方法整理
  2. matlab中的图像,MATLAB中图像的基本操作
  3. private访问权限java_Java之访问权限
  4. ethercat主站控制软件TwinCAT的安装
  5. LeetCode 339. 嵌套列表权重和(DFS)
  6. spring 数组中随机取几个_准备几个月,面试阿里耗时两周,最终凭借这些知识拿下阿里offer...
  7. SpringBoot指南(七)——SpringBoot整合Mybatis
  8. 怎样把ACCESS导入SQL数据库
  9. KeepLive for Android 安卓保活组件
  10. 一台电脑群控上百台手机是什么样?
  11. SCSI硬盘数据如何用EasyRecovery恢复
  12. mysql集群master和salve配置mysql的master和salve详解事件
  13. Windows10制作双系统来越狱 ios13.3.1(非常方便,不要U盘)
  14. 【2019年03月29日】股票的滚动市盈率PE最低排名
  15. 一连发布三个版本,Boot要上天?
  16. 微信小程序实现列表页的点赞和取消点赞功能!
  17. MPI 矩阵乘法 并行优化
  18. 使用邮件,有哪些邮箱格式模板需要注意的么?
  19. python实现坐标点的系统转换
  20. 2021-7-5目录穿越ssrf配合RFI漏洞学习笔记转

热门文章

  1. DeepFlow:做好云原生时代的网络监控
  2. 参考文献中英文人名_参考文献英文名字应该怎么写?
  3. 中国人保为易集康健康科技承保产品责任险,为消费者保驾护航!
  4. 小米是最能赚外国人钱的国产手机品牌,其他手机品牌只能窝里横
  5. AI 上当,“苹果”变 “iPod”
  6. 36艺教育完成3000万元Pre-A轮融资,星火资本投资 1
  7. 导出android app安装包,Android app导出apk方法
  8. python 货币找零
  9. a = a + 1, a++, ++a ,a+=1区别
  10. 2018 DDoS攻击加剧,闻“D”色变的无力困境,我们要怎么办