I got the following formula giving me the right result, but since it'll be in a couple of a thousand rows, it takes too long to calculate and, sometimes, it doesn't even return the result:
=(INDEX($F$2:$F,MATCH(maxifs($B$2:$B,$A$2:$A,$A2),$B$2:$B,0),)>Averageifs($F$2:$F,$B$2:$B,"<="&MAXIFS($B$2:$B,$A$2:$A,A2),$B$2:$B,">="&WORKDAY(MAXIFS($B$2:$B,$A$2:$A,A2),-10)))
Here's a copy containing dummy data and the hurdle highlighted, if you could help with any pointers: https://docs.google.com/spreadsheets/d/1sTehnvkjDtZE6PUpXYdiMFKZFwA10EUbzEdszWPDryY/edit?usp=sharing
Thank you!
You can consider using Custom Formula to process your data with Apps Script.
/**
* @customfunction
*/
function compareCloseDateToDays(value) {
var result = value.flat().filter(String);
var latest = result[result.length-1];
var tenDays = result[result.length-11];
Logger.log(latest);
Logger.log(tenDays);
return(latest>tenDays);
}
/**
* @customfunction
*/
function compareCloseDateToAve(value) {
var result = value.flat().filter(String);
var latest = result[result.length-1];
var tenAve = result.slice(result.length-10);
var sum = 0;
var ave = 0;
for (var i = 0; i < tenAve.length; i++) {
sum += tenAve[i];
}
ave = sum/tenAve.length;
Logger.log(latest);
Logger.log(ave);
return(latest>ave);
}
=compareCloseDateToDays(F7:F)
=compareCloseDateToAve(F7:F)
In your original formula, you include a criteria where column A should match A8 when getting the max value of the date.
You can use Filter() to filter column F before calling the custom functions.
Then use this function: =compareCloseDateToDays(filter(F7:F,A7:A=A8))
The output is "TRUE"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.