How to Average Only Non-Zero Values Using AverageIfs with Index/Match

DrExcellence

New Member
Joined
Jun 17, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Here is my current formula:

AVERAGEIFS ( INDEX ( $H$10:$X$505, , MATCH ( [SKU], $H$10:$X$10, 0)), $E$10:$E$505, [City], $F$10:$F$505, [Store Name])

I am trying to summarize the average prices (H11-X505) by product (header cells H10-X10), city and store (Columns E-F) in a separate table using this formula. It works fine, but the problem I'm facing is that the average is including zeroes and incorrectly giving me very low numbers. Does anyone know what I need to add to this formula so that it averages only non-zero values? (I'm not able to change the zero values to blanks because the zeroes are necessary for other functionality).

Any guidance will be greatly appreciated.
 

Attachments

  • ex.JPG
    ex.JPG
    28 KB · Views: 27

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi & welcome to MrExcel.
How about
Excel Formula:
=LET(Rng,INDEX($H$10:$X$505, ,MATCH([SKU], $H$10:$X$10, 0)),AVERAGEIFS(Rng,Rng,"<>0", $E$10:$E$505, [City], $F$10:$F$505, [Store Name]))
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=LET(Rng,INDEX($H$10:$X$505, ,MATCH([SKU], $H$10:$X$10, 0)),AVERAGEIFS(Rng,Rng,"<>0", $E$10:$E$505, [City], $F$10:$F$505, [Store Name]))
Thanks so much!! Works perfectly!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,629
Members
452,661
Latest member
Nonhle

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