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

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"

Related

Excel Formula caculating number days of year between 2 dates

I am looking for an excel formula to calculating the number of days from years between "Start date" & "end date"
Example :
My start date is 06/19/2020
My end date is 06/20/2023
I would to know on this example the number of days from year 2020 => from start date ; year 2021 (full year) ; year 2022 (full year) ; 2023 => from end date
Result :
number of days of 2020 : 195
number of days of 2021 : 365
number of days of 2022 : 365
number of days of 2023 : 170
in my databse i have different start date and end date by line to x year
Thanks for your help
You can simply substract one cell value from another, if for example:
A1 = TODAY() (which returns today's date)
A2 = 1/01/2019
B1 = A1-A2 = 765 days
Hope it was helpful for you
You might be interested in the DATEDIF function:
https://stackoverflow.com/a/73268311/13406526
Sorry, but I'm a newbie, cannot add comments.

How to convert a decimal number to numbers in days, hours, and min in Excel

I have a simple cell A2 (48.48333333). I want to convert this number to number of days, numbers of hours, and number of minutes. I expect to see 2 days, and 30 minutes (conversion note: numbers after the decimal (.) would be converted as follow: .50 = 30 minutes, .25 = 15 minutes, .75 = 45 minutes) in this example, .48333333 would be 30 minutes).
Here is my attempts so far but the result is not what I expected.
=INT(A2) & " Days " & INT(MOD(A2, INT(A2))*24) & " Hours and " & MINUTE(A2) & " Minutes"
=TEXT(A2, "d \d, h\hr, m \m")
Is there a link or method in Excel that I can convert A2 cell into days, hours, and minutes?
Use:
=INT(A2/24) & "d " & TEXT(A2/24,"h\h m\m")
This will do the job ONLY if the total hour is less than 768 (or 32 days) as being pointed out by #ForwardEd:
=TEXT(A1/24,"d\d h\h m\m")
OK I know this is old, but if someone found this looking for the answer as I did. Here is what you can do.
If you have decimal value in days. i.e 52.85385614
Which is: 52 days, 20 hours, 29 minutes, 33.171 seconds, you need to use a formula to format it. (value in cell B7, formula in cell C7)
=CONCAT(INT(B7),".",TEXT(B7-TRUNC(B7),"hh:mm:ss.000"))
This will produce a value of: 52.20:29:33.171

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

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

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).

Resources