Date manipulation

kolly

New Member
Joined
Mar 11, 2009
Messages
20
I want to first of all thank Yard for his wonderful solution to my earlier problem. - Yard, you too much!
My question now is, If I have 03-March-2009 in cell D1 and D2 has the value 2, how can I add up D1 and D2 to produce 03-May-2009. I mean I want (03/03/2009)+2=03/05/2009, (02/04/2008)+5=02/09/2008, (25/10/2008)+7=25/05/2009, etc
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
5,190
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
=date(year(d1),month(d1)+d2,day(d1))
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
If D1 is 31/08/2008 and D2 is 6 what should the answer be? Dave's formula will give 03/03/2009

This formula will give 28/02/2009

=EDATE(D1,D2)

although EDATE is an Analysis ToolPak function. To get the same result with native functions

=MIN(DATE(YEAR(D1),MONTH(D1)+D2+{0,1},DAY(D1)*{1,0}))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,559
Messages
5,832,488
Members
430,136
Latest member
Asir Jefferson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top