How to utilize date add function in Google spreadsheet?

前端 未结 10 737
忘掉有多难
忘掉有多难 2021-02-04 23:46

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

相关标签:
10条回答
  • 2021-02-04 23:58

    =TO_DATE(TO_PURE_NUMBER(Insert Date cell, i.e. AM4)+[how many days to add in numbers, e.g. 3 days])

    Looks like in practice:

    =TO_DATE(TO_PURE_NUMBER(AM4)+3)
    

    Essentially you are converting the date into a pure number and back into a date again.

    0 讨论(0)
  • 2021-02-04 23:59

    Using pretty much the same approach as used by Burnash, for the final result you can use ...

    =regexextract(A1,"[0-9]+")+A2
    

    where A1 houses the string with text and number and A2 houses the date of interest

    0 讨论(0)
  • 2021-02-05 00:03
    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.

    0 讨论(0)
  • 2021-02-05 00:03

    As with @kidbrax's answer, you can use the + to add days. To get this to work I had to explicitly declare my cell data as being a date:

    A1: =DATE(2014, 03, 28)
    
    A2: =A1+1
    

    Value of A2 is now 29th March 2014

    0 讨论(0)
  • 2021-02-05 00:04

    You can use the DATE(Year;Month;Day) to make operations on date:

    Examples:

    =DATE(2013;3;8 + 30) give the result...  7 april 2013 !
    =DATE(2013;3 + 15; 8) give the result... 8 june 2014 !
    

    It's very surprising but it works...

    0 讨论(0)
  • 2021-02-05 00:16

    I like to keep it simple. If A1 holds the date and B1 holds the number of months to add, then

    =date(year(A1),month(A1)+B1,day(A1))
    

    would calculate the required result. The same way could be used for days or years

    0 讨论(0)
提交回复
热议问题