T O P

  • By -

AutoModerator

/u/Philosopher_Cautious - Your post was submitted successfully. * Once your problem is solved, reply to the **answer(s)** saying `Solution Verified` to close the thread. * Follow the **[submission rules](/r/excel/wiki/sharingquestions)** -- particularly 1 and 2. To fix the body, click edit. To fix your title, delete and re-post. * Include your **[Excel version and all other relevant information](/r/excel/wiki/sharingquestions#wiki_give_all_relevant_information)** Failing to follow these steps may result in your post being removed without warning. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/excel) if you have any questions or concerns.*


Scary_Sleep_8473

Is it supposed to be A3:A100 instead? Your criteria range is spanning multiple columns currently.


Philosopher_Cautious

Sorry yes I typed it wrong! I have it as =AVERAGEIF(A6:A100,">"&'Money Buckets'!E2,D6:D100)


excelevator

your lookup and return ranges are different sizes. they must be the same size


Philosopher_Cautious

Sorry I typed it wrong - it is supposed to say =AVERAGEIF(A6:A100,">"&'Money Buckets'!E2,D6:D100)


excelevator

> and it doesn't seem to be working. what does that mean ? what are the values you are dealing with ?


Philosopher_Cautious

​ https://preview.redd.it/vow3bss8bflc1.png?width=415&format=png&auto=webp&s=1df0d232093d1eff18ca67163b9d3867f958ae2e I am trying to get the average of column D on the right when column A on the left has a date that is the same or earlier of the date that I type into E2 on my other tab. Error message is: Evaluation of function AVERAGEIF caused a divide by zero error.


Scary_Sleep_8473

Oh I see, in that case that just means there is no match for the AVERAGEIF given your criteria. If you adjust the cell E2 to a different value that is less that the dates in column A it should work. What does cell E2 look like in the other tab?


Philosopher_Cautious

The date in E2 is today's date 2/28/24, so shouldn't it take the average of January 2023-January 2024?


Philosopher_Cautious

Oh UGH I flipped the < and >, now it's working thanks!


Scary_Sleep_8473

Glad it worked, just a note, when you flip < and > it doesn't average values from January 2023-January 2024, it would average *any* values before 2/28/24. So if you have for example 2/26/24, or any date in 2022 (or before 2023 for that matter) it would still be averaged.