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
andre72Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.