Date Fomula

gymwrecker

Active Member
Joined
Apr 24, 2002
Messages
396
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I'm trying to come up with a formula to determine the number of years, months, and days (in this format) when subtracting from a specific value, i.e.

17 Years, 0 Months, 0 Days (this will always be the same and will not change)

For example, I need to deduct 15 Years, 5 Months, 25 Days from 17 Years, 0 Months, 0 Days, and need the result to be in the same format (2 Years, 7 Months, 5 Days)

Any help is greatly appreciated.
 
Last edited:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Please explain how you calculate the result that you show.

A few examples posted with the forums tool named XL2BB would be helpful.

If you convert your example to dates, how may days would be the difference?
 
Upvote 0
That's not going to be so simple. Since the time span "1 year, 1 month" for example can be very different depending on where this time span starts. If the year has 366 days or 365, how many days the month in that time span have.
You would need to tell us a little more about how you want to subtract these times and what the expected result should look like.
Where do these timespans you are subtracting come from?
Can you share some more examples?
 
Upvote 0
I'm basically converting Active Duty (Army) points (1 active-duty day equals one active-duty point) into dates:

i.e., 5,992 points is the equivalent of 16.4 years, or 16 Years, 5 Months, 2 Days (you get this by dividing 5,992/365).

So, for example, in cell B3 I have the following value: 5,992, and in cell B4 I have the following formula =INT(B3/365)&" Years, "&INT(MOD(B3,365)/30)&" Months, "&ROUND(MOD((MOD(B3,365)),30),0)&" Days", and the result displayed in B4 is 16 Years, 5 Months, 2 days (this is the format I need).

I'm looking for a formula that returns the difference in Years, Months, and Days by Subtracting the result in B4 from 17 Years, 0 Months, 0 Days (this is a standard value and cannot be changed).

I hope this helps!!!!
 
Upvote 0
That's not going to be so simple. Since the time span "1 year, 1 month" for example can be very different depending on where this time span starts. If the year has 366 days or 365, how many days the month in that time span have.
You would need to tell us a little more about how you want to subtract these times and what the expected result should look like.
Where do these timespans you are subtracting come from?
Can you share some more examples?
I can use 365 as a standard....
 
Upvote 0
Please try to answer the questions in #2 and #3.

What is your source information and what is the expected result.
Please post your examples with the forum's tool named XL2BB.
 
Upvote 0
I'm basically converting Active Duty (Army) points (1 active-duty day equals one active-duty point) into dates:

i.e., 5,992 points is the equivalent of 16.4 years, or 16 Years, 5 Months, 2 Days (you get this by dividing 5,992/365).

So, for example, in cell B3 I have the following value: 5,992, and in cell B4 I have the following formula =INT(B3/365)&" Years, "&INT(MOD(B3,365)/30)&" Months, "&ROUND(MOD((MOD(B3,365)),30),0)&" Days", and the result displayed in B4 is 16 Years, 5 Months, 2 days (this is the format I need).

I'm looking for a formula that returns the difference in Years, Months, and Days by Subtracting the result in B4 from 17 Years, 0 Months, 0 Days (this is a standard value and cannot be changed).

I hope this helps!!!!
Why don't we subtract the points and after that we covert to years, month... ? Would that work? Because I guess that 17 years is the equivalent of some number of points in the end. (17*365 = 6205 for example?)
 
Upvote 0
Dates and Time 2024.xlsm
ABCDE
1Days in365.2425
2Target Days6,2096,209Days in month30.4369
3Points to date5,9924,000
4Days2172,209
5Years0.596.05
6Months772
7
8
96209.255992217.252209
101716.410.596.047222222
1117 Years, 0 Months, 0 Days16 Years, 4 Months, 26 Days0 Years, 7 Months, 4 Days6 Years, 0 Months, 17 Days
12
5bb
Cell Formulas
RangeFormula
B2B2=17*E1
C2C2=B2
E2E2=365.2425/12
B4:C4B4=B2-B3
B5:C5B5=B4/$E$1
B6:C6B6=INT(DOLLARFR(B4/$E$2,12))
A9A9=17*365.25
C9C9=A9-B9
A10:D10A10=YEARFRAC(0,A9)
A11:D11A11=INT(A9/$E$1)&" Years, "&INT(MOD(A9,$E$1)/$E$2)&" Months, "&ROUNDDOWN(MOD((MOD(A9,$E$1)),$E$2),0)&" Days"
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,120
Members
453,021
Latest member
Justyna P

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