Alper Takci
New Member
- Joined
- May 14, 2014
- Messages
- 18
Hello,
I am using a formula that calculates the length of time in Years, Months and Days. The formula is built up in a way that the result comes in as an alphanumeric value such as "2 Years 9 Months 3 Days". This formula is applied to a column of about 5000 lines. What I would like to accomplish is to get the average of the entire column. The beginning date of any row is coming from a cell in that row however the end date may be either today or an end day in that row if there exists one. Below also you can see the formula I am using.
The second step after achieving the average is to put a condition such as if there is a specific word in a cell in a row then the formula should add the calculated length of time from that row to the average calculation.
Hope I was clear enough. Thanks in advance for your help.
The formula:
=IF(M9>0;IF(DATEDIF(L9;M9;"Y")=0;" ";DATEDIF(L9;M9;"Y")&" years ")&IF(DATEDIF(L9;M9;"ym")=0;" ";DATEDIF(L9;M9;"ym")&" months ")&IF(DATEDIF(L9;M9;"md")=0;" ";DATEDIF(L9;M9;"md")&" days");IF(DATEDIF(L9;$H$3;"Y")=0;" ";DATEDIF(L9;$H$3;"Y")&" years ")&IF(DATEDIF(L9;$H$3;"ym")=0;" ";DATEDIF(L9;$H$3;"ym")&" months ")&IF(DATEDIF(L9;$H$3;"md")=0;" ";DATEDIF(L9;$H$3;"md")&" days"))
As you might guess, L9 is the beginning date and M9 is the end date if it exists. H3 is where I store Today().
I am using a formula that calculates the length of time in Years, Months and Days. The formula is built up in a way that the result comes in as an alphanumeric value such as "2 Years 9 Months 3 Days". This formula is applied to a column of about 5000 lines. What I would like to accomplish is to get the average of the entire column. The beginning date of any row is coming from a cell in that row however the end date may be either today or an end day in that row if there exists one. Below also you can see the formula I am using.
The second step after achieving the average is to put a condition such as if there is a specific word in a cell in a row then the formula should add the calculated length of time from that row to the average calculation.
Hope I was clear enough. Thanks in advance for your help.
The formula:
=IF(M9>0;IF(DATEDIF(L9;M9;"Y")=0;" ";DATEDIF(L9;M9;"Y")&" years ")&IF(DATEDIF(L9;M9;"ym")=0;" ";DATEDIF(L9;M9;"ym")&" months ")&IF(DATEDIF(L9;M9;"md")=0;" ";DATEDIF(L9;M9;"md")&" days");IF(DATEDIF(L9;$H$3;"Y")=0;" ";DATEDIF(L9;$H$3;"Y")&" years ")&IF(DATEDIF(L9;$H$3;"ym")=0;" ";DATEDIF(L9;$H$3;"ym")&" months ")&IF(DATEDIF(L9;$H$3;"md")=0;" ";DATEDIF(L9;$H$3;"md")&" days"))
As you might guess, L9 is the beginning date and M9 is the end date if it exists. H3 is where I store Today().