AverageIfs function only returns first matching value

LambChoptheKid

New Member
Joined
Dec 10, 2022
Messages
35
Office Version
  1. 365
Platform
  1. Windows
I have a problem with an excel averageifs formula in that it only returns the first matching value, and does not average all values which correspond to the right criteria.

The goal is to average every value which corresponds to a particular hour of the day. I've attached a screenshot below.

For example, for the hour of 1:00 AM I would like to take an average of every value in row C which corresponds to a value of 1:00 AM in row B.

The formula in in G2 is as follows: =AVERAGEIFS(C:C, B:B, F2)

I have had success with using this formula before for similar projects and I cannot figure out why this is not working.

Any assistance will be appreciated.

Thank you
 

Attachments

  • AverageIfs screenshot.png
    AverageIfs screenshot.png
    87.3 KB · Views: 26
That was the problem. Just looked into the time values in the lower portions of the data and found that they were stored as dates.

It's always the small errors lol.

Thank you!!
My pleasure, happy to help you find a solution.
Regarding TIME VALUES.... I always enter time as DATETIME. If you have only TIME values and go past midnight on a schedule it drives me crazy, and it ensures consistency.

But in your circumstance you could have gotten matches by using the MOD function:

Mod(DATETIMEVALUE,1) = Mod(Time(1,0,0),1) where the first expression is your column of data and the second is the COUNTIF Time Value.

Best Wishes!
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top