如何在Google电子表格中使用日期添加功能? [英] How to utilize date add function in Google spreadsheet?

查看:163
本文介绍了如何在Google电子表格中使用日期添加功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信我现在的问题在MS Excel中应该容易得多。然而,由于我的公司使用Google电子表格,所以我必须找出一个方法。



基本上,我有一个包含日期值的单元格,如12/19/11 我有另一个单元格包含像DT 30的值。分配给我的任务是将值30(天)添加到日期,因此结果应为1/19/2012。



我做了一些尝试在Google电子表格中,我有两个问题。第一个是如何从字符串DT 30中提取数字值30,第二个问题是Google文档中似乎没有添加日期添加功能。



任何专家可以提供一些建议吗?感谢您帮助初学者!

解决方案


  1. 从字符串中提取数值您可以使用这两个函数(假设您在单元格A1中具有值):



    = VALUE(REGEXEXTRACT(A1,\ d +))



    这将获得一个数值。


  2. p>我在文档中没有发现日期添加功能,但是您可以将日期转换为内部日期数字,然后添加天数(如果您的值在单元格'A2'中):



    = DATEVALUE(A2)+ 30




<我希望这将有所帮助。


I believe the issue I am having now should be much easier in MS Excel. However, since my company uses Google Spreadsheet so I have to figure out a way.

Basically, I have a cell that contains a date value like "12/19/11", and I have another cell contains a value like "DT 30". The task assigned to me is to add the value 30(days) to the date, so the result should be "1/19/2012".

I did some trying in Google Spreadsheet, I have two questions. The first is to how to extract the numeric value "30" out of the string "DT 30", the second question is that, there seems to be no date add function built in Google Docs.

Could any experts offer some suggestions? Thanks for helping a beginner!

解决方案

  1. To extract a numeric value out of your string you can use these 2 functions (Assuming you have your value in cell 'A1'):

    =VALUE(REGEXEXTRACT(A1, "\d+"))

    This will get you a numeric value.

  2. I've found no date add function in docs, but you can convert your date into internal date number and then add days number (If your value is in cell 'A2'):

    =DATEVALUE(A2) + 30

I hope this will help.

这篇关于如何在Google电子表格中使用日期添加功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆