I am having some issues to calculate an average number using WorksheetFunction.AverageIfs() with 5 different conditions (each one in a different range).
And when I run the code a Run time Error occurs (Unable to get the AverageIfs properties of the WorkSheet function).
There are two workbooks that I use, one with the database (data.xlsx) and another that I consolidate the data.
What I am trying to do is to calculate the average number of days that i have to perform each set of contracts that start on the same day for each starting date (some contracts start on the same date but have different deadlines).
Data regarding contract duration is available in the database.
What I observed is that the error occurs on the first date iteration probably because the second outcome is #DIV/0! (I tried using the excel formula and that's what happened - maybe the system doesn't deal very well with such error). But I am not sure about this conclusion
What should I do to avoid such problem? How can I circumvent this issue?
I attached both the samble database and the macro file
Thanks
Bookmarks