Add or subtract durations in years, months, days format

Tlsoi

New Member
Joined
Mar 22, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hello everyone,

I am trying to add or subtract durations in years, months, days format; but i could not figure it out how to do it.

For example, Column A, B and C refers to years, months and days respectively.

A1 = 4 (years), B1 = 7 (months), C1 = 19 (days)
A2 = 1 (years), B2 = 11 (months), C2 = 20 (days)

I want to add or subtract these two rows and show it in row 3.
If i add them up, the result will be 5 years, 18 months, 39 days. However, i want it to shift the days bigger than 30 and the months bigger than 12 to aside and automatically calculate the result as 6 years, 7 months and 9 days.

I really apprecatiate your help.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Something like this perhaps?
Book1
ABC
1YearsMonthsDays
24719
311120
4
5679
Sheet1
Cell Formulas
RangeFormula
A5A5=SUM(A2:A3,INT(SUM(B2:B3,INT(SUM(C2:C3)/30))/12))
B5B5=MOD(SUM(B2:B3,INT(SUM(C2:C3)/30)),12)
C5C5=MOD(SUM(C2:C3),30)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi,

Try:

Book3.xlsx
ABC
14719
211120
3679
Sheet854
Cell Formulas
RangeFormula
A3A3=A1+A2+INT((B1+B2)/12)
B3B3=MOD(B1+B2,12)+INT((C1+C2)/30)
C3C3=MOD(C1+C2,30)
 
Upvote 0
You're welcome, thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

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
Back
Top