Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel -- displaying date that is X months from today

Tags:

excel

Any easy way to do this? In VBA I'd normally use dateadd() but since this is Excel, I don't have that function.

like image 305
John Smith Avatar asked Jan 27 '26 23:01

John Smith


2 Answers

The following function does the job:

=DATE(YEAR(A2),MONTH(A2)+B2,MIN(DAY(A2),DAY(DATE(YEAR(A2),MONTH(A2)+B2+1,0))))

For example:

Date       Add Months   Result  
8/1/2012   6            =DATE(YEAR(A2),MONTH(A2)+B2,MIN(DAY(A2),DAY(DATE(YEAR(A2),MONTH(A2)+B2+1,0))))

Result:

Date       Add Months   Result  
8/1/2012   6            2/1/2013
like image 147
Anne Avatar answered Jan 30 '26 20:01

Anne


You could also use the EDATE worksheet function. For example EDATE(DATE(2012,8,1),6) returns February 1, 2013.

like image 38
Brian Camire Avatar answered Jan 30 '26 18:01

Brian Camire



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!