Jul 06 2022 03:10 PM
Hello,
Trying to find the average duration of a project metric in the past month.
=(AVERAGEIF('Onboarding Interface Tracker'!T6:T285, ">0") AND (COUNTIF('Onboarding Interface Tracker'!S6:S285,">"&DATE(YEAR(TODAY))),MONTH(TODAY)())-1,0))-COUNTIF('Onboarding Interface Tracker'!S6:S285,">"&TODAY()-DAY(TODAY()))
I am pulling the average from another column that already contains a formula.
Would also like to make one for the past year.
I get an error.
Jul 06 2022 04:02 PM - edited Jul 06 2022 04:04 PM
@nini8519 There appear to be a number of issues with that formula including wrong () groupings and trying to AND your AVERAGEIF with other conditions AND trying to subtract 2 COUNTIF statements. Try this (I didn't actually test it but should be close if not right):
=AVERAGEIFS('Onboarding Interface Tracker'!T6:T285,
'Onboarding Interface Tracker'!T6:T285, ">0",
'Onboarding Interface Tracker'!S6:S285,">"&EOMONTH(TODAY(),-2),
'Onboarding Interface Tracker'!S6:S285,"<="&EOMONTH(TODAY(),-1)
)
is that >0 criteria required?
As for past year you can use similar format and use EOMONTH(..., -13) for the past 12 months or use that DATE(...) format you were using. (Using DATE() wasn't a problem except that you had misaligned (), I just switched to EOMONTH because it is cleaner and easier to read)
Hope that helps
Jul 06 2022 04:51 PM
@mtarler Thank you so much. Yes, that was able to capture what I needed to do!
Much thanks again.
Jul 06 2022 05:59 PM
@mtarler I have another part to this that I am getting stumped.
My final calculation is to obtain a percentage of completed projects in the last month where another column of legacy data is not blank.
I was able to do the calculation for a timeframe of all time projects and successfully got a percentage.
=COUNTA('Onboarding Interface Tracker'!AG6:AG285)/COUNTA('Onboarding Interface Tracker'!AI6:AI285)
I counted the number of cells that had dates in the legacy column and divided that by number of cells that had dates in the completed projects column.
This is where I am getting stuck because I need to add a condition to the completed projects column from the past month. That column is the AI6:AI285 one.
I tried this, but I am getting 600% as an answer:
=(COUNTA('Onboarding Interface Tracker'!AG6:AG285))/(COUNTIF('Onboarding Interface Tracker'!AI6:AI285,">"&DATE(YEAR(TODAY()),MONTH(TODAY())-1,0))-COUNTIF('Onboarding Interface Tracker'!AI6:AI285,">"&TODAY()-DAY(TODAY())))
Jul 07 2022 05:27 AM