Excel - how to calculate age from 'Age in Months' - excel

If a person's age in months is 140 how could I calculate there age in Years and Months?
So for example I would want to see:
11 Years 8 Months

To get the months: =MOD(140,12)
To get the years: =ROUNDDOWN(140/12,0)
Putting it together =ROUNDDOWN($A$1/12,0) & " Years " & MOD($A$1,12) & " Months" where $A$1 holds the value (140).

Related

Datedif issue - convert number of days to "--Years--Months--Days" format

I should convert number of days to "--Years--Months--Days" format. I am mostly calculating the percentages of working days.
=DATEDIF(B2,C2,"y")&" years "&DATEDIF(B2,C2,"ym")&" months "&DATEDIF(B2,C2,"md")&" days"
works well for date to date. Here, I need numbers of days. in to "--Years--Months--Days" format.
e.g: 10 Sep 2021 to 01 Mar 2023 (546 days) 75% of 546 is 409.5 I need to calculate how many years months days of 409.5 days. Is it possible?
Try,
=DATEDIF(0,DATEDIF(B2,C2,"D")*0.75,"Y") & " Years, " & DATEDIF(0,DATEDIF(B2,C2,"D")*0.75,"YM") & " Months, " & DATEDIF(0,DATEDIF(B2,C2,"D")*0.75,"MD") & " Days"

how to get difference between two dates in sharepoint calculated column

how to get different between two dates: column1 "joining date" column2 "leaving date", in sharepoint calculated column as "total experience of an employee"?
The desired output I'm searching is in this format for example: "2 days 2 months 2 years".
this formula should give you the answers that you are after
= DATEDIF([Date 1],[Date 2],"MD")&" Days "& DATEDIF([Date 1],[Date 2],"YM") &" Months "& DATEDIF([Date 1],[Date 2],"Y") &" Years"
Steps:
Create a calculated column of type Single Line of text
Use the formula above.
Explanation:
Formula goes as
DATEDIF(Start_date,End_date,"Interval")
Where interval can be:
Y Calculate the number of complete years
M Calculate the number of complete months
D Calculate the number of days
YM Calculate the number of months excluding years
MD Calculate the number of days excluding years and months
YD Calculate the number of days excluding years
For 2 dates like Date 1 (31/01/2020) and Date 2 (14/05/2020), the results will be:
14 Days 3 Months 0 Years

MS Excel how to convert hours to days with only 8 hour period

I have an internship with remaining hours of 136:35:00. I want to automatically calculate how many days will I need to consummate the hours in excel but with 8 hours a day period.
I tried using this:
=INT((M10)) &" Days " & INT(MOD(M10,INT(M10))*24) & " Hours and " &
MINUTE(A11) & " Minutes"
but it gave me a literal 24-hour/day period, hence the output:
5 Days 16 Hours and 0 Minutes
what am I missing in the formula?
Assuming 136:35:00 is in Cell A1, try
=CEILING(TEXT(A1, "[h]")/8,1)
If you're looking for day and hours combination, then try
=FLOOR(A1*3,1)&" Days and "&TEXT(SUM(A1,-TIME(8,0,0)*FLOOR(A1*3,1))," h") & " Hours " & MINUTE(A1) & " Minutes "& SECOND(A1) & " Seconds"
If you are not interested in Seconds, then use
=FLOOR(A1*3,1)&" Days and "&TEXT(SUM(A1,-TIME(8,0,0)*FLOOR(A1*3,1))," h") & " Hours " & MINUTE(A1) & " Minutes "
EDIT :
FLOOR Function
Syntax : FLOOR(number, significance) where number is numeric value you want to round and significance is multiple to which you want to round
FLOOR function rounds a number down to the nearest multiple of significance.
Now, for example say you have 25:00:00 in Cell A1 then to break it down to number of days (as your requirement is to calculate number of days based on 8 hours a day), you'll have to use =FLOOR(A1*24/8,1) which is same as =FLOOR(A1*3,1). This will give result as 1 day.
You can also use another simpler formula
=INT(A1/"8:00")&" days "&TEXT(MOD(A1/"8:00",1)*8/24,"h"" Hours ""m"" Minutes ""s"" Seconds""")

In Excel, how do I calculate days between two dates ignoring full years?

How do I calculate relative years + days between two dates in excel? I want to know the number of years and any additional days (outside of the full years). Dividing the total days by 365 doesn't work because of leap years. For example:
Cell A1 = '1/31/2015'
Cell B1 = '2/1/2025'
Cell C1 = '2/11/2025'
=(B1-A1)/365 # 10.0109 = 10 years + 4 days, looking for 10 years + 0 days
=(C1-A1)/365 # 10.0383 = 10 years + 14 days, looking for 10 years + 10 days
Is there an easy way to calculate this?
Note - this question is not a duplicate of How to find the difference between dates in VBA -- which is a question about calculating the difference between dates. This question is asking how to calculate the difference of both years and days, such that the difference in days is for the final year only, and are not incorrectly including leap year days for previous years.
You can use the documented function DATEDIF
=DATEDIF(startdate,enddate,"Y")
This will give you the difference in whole years
“Y” Returns the period difference as complete years.
“M” Returns the period difference as complete months.
“D” Returns the number of days in the period.
“MD” Returns the difference between the days in ‘Start_Date’ and ‘End_Date’. Here the months and years of the dates are ignored.
“YM” Returns the difference between the months in ‘Start_Date’ and ‘End_Date’. Here the days and years of the dates are ignored
“YD” Returns the difference between the days of ‘Start_Date’ and ‘End_Date’. Here the years of the dates are ignored.
Excel Solution :
=DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & " months, " & DATEDIF(A1,A2,"md") & " days"
Please refer this link

Sharepoint - End date minus Start date = Years?

I am needing to calculate the number of years between two fields;
Field A
Start Date (dd/mm/yyyy)
Field B
End Date (dd/mm/yyyy)
Field C
Calc formula display difference between Field A and B in years and months i.e 5.2
Thanks all.
Assuming you are asking about Calculated Columns then you need the DATEDIF function
Also I am assuming that the 5.2 is 5 years and 2 months - not 5 years and .2 of a year - be a bit more specific in your question and you will get better answers.
So
= DATEDIF([Start Date],[End Date],"Y")
& " years and " &
DATEDIF([Start Date],[End Date],"YM")
& " months "
Examples of common formulas

Resources