iskbaloch
iskbaloch

Reputation: 197

Calculate a date from an upcoming month after specific date in Excel?

My question how to calculate "C" in following table using formula in Excel, whereas "C" is a date of same month/date of "A" but coming after date in "B"?

          A                  B                  C               
     ---------------------------- ---------------------------- 
1     Jun 22, 2016       Jan 22, 2020         ? (Jun 22, 2020)    => C = next "Jun 22" coming after B
2     Feb 15, 2018       Dec 22, 2019         ? (Feb 15, 2020)
3     Feb 26, 2019       Apr 22, 2019         ? (Feb 26, 2020) 
4     Dec 21, 2016       Dec 22, 2019         ? (Dec 21, 2020)

Note: VBA is not applicable.

Upvotes: 0

Views: 66

Answers (1)

bosco_yip
bosco_yip

Reputation: 3802

In C1, formula copied down :

=IF(DATE(YEAR(B1),MONTH(A1),DAY(A1))>B1,DATE(YEAR(B1),MONTH(A1)+1,DAY(A1)),DATE(YEAR(B1)+1,MONTH(A1),DAY(A1)))

enter image description here

Upvotes: 1

Related Questions