• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Add Days to a date using Excel

Hi,

Iin a cell I've a date format like that:
2011-04-02T19:23:45.000Z

Now I like to add some days to it ...

What is the right way to do so?

Thanks

Andre
0
andre72
Asked:
andre72
  • 3
2 Solutions
 
SiddharthRoutCommented:
I would use this simple formula

=VALUE(LEFT(A1,10))+1

and custom format the cell to "yyyy-mm-dd"

Sid
0
 
SiddharthRoutCommented:
Or this, in case I do not want to manually format the cell.

=TEXT(VALUE(LEFT(A1,10))+1,"yyyy-mm-dd")

Sid

BTW I am assuming that Cell A1 contains 2011-04-02T19:23:45.000Z
0
 
SiddharthRoutCommented:
One last thing that I forgot to mention. I am adding 1 day to that date. In case you want to 'n' days then simply replace the N with the number of days in the formula.

=VALUE(LEFT(A1,10))+N

or

=TEXT(VALUE(LEFT(A1,10))+N,"yyyy-mm-dd")

Sid
0
 
Patrick MatthewsCommented:
Andre,

Sid's suggestions will strip off the time portion.  If you want to keep the time portion...

1) If the value is a true date/time and you are simply using the number format yyyy-mm-ddThh:mm:ss.000Z to display it that way:

=A1+1  (or whatever # of days)

2) If that is a text value:

=LEFT(A1,10)+MID(A1,12,8)+1  (or whatever # of days)

That returns a true date/time.  To return it as text:

=TEXT(LEFT(A1,10)+MID(A1,12,8)+1,"yyyy-mm-ddThh:mm:ss.000Z")

Patrick
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now