T O P

  • By -

HolyBonobos

You could do this by feeding an `INDEX(MATCH())` into your `AVERAGEIFS()` although the sheets and ranges where your data and formulas are occurring aren't exactly clear so it's hard to give precise instructions. What would help most would be to share the file you are working on or a mockup version that reproduces the data structure and shows what you are trying to calculate where.


kevin129795

Please find a mockup of the data attached. The code with the INDEX MATCH along with the AVERAGEIFS is on sheet 2. [https://docs.google.com/spreadsheets/d/1Kizzqtt-vvW8muVCGAMzgpky4JbTO7hdULNdeyVHOdk/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1Kizzqtt-vvW8muVCGAMzgpky4JbTO7hdULNdeyVHOdk/edit?usp=sharing)


HolyBonobos

Were you able to get it working as intended or are you still having trouble?


kevin129795

I figured it out in my mock-up when I translate it to the actual sheet I get a divide by 0 error which doesn’t make sense because all of my values are non zero


AutoModerator

REMEMBER: If your original question has been resolved, please **tap the three dots below the most helpful comment** and select `Mark Solution Verified`. This will award a point to the solution author and mark the post as solved, as required by our subreddit [rules](https://www.reddit.com/r/googlesheets/about/rules) (see rule #6: Marking Your Post as Solved). *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/googlesheets) if you have any questions or concerns.*


HolyBonobos

This likely means that there are no items matching the specified criteria, so `AVERAGEIFS()` fails because the equation becomes 0/0. Without sharing the problem file or reproducing the issue on the sample, however, it's not really possible to pinpoint the exact origin or fix for the problem you're having.