IFERROR() result such as it is ignored by AVERAGE()?

siamond

New Member
Joined
Mar 19, 2019
Messages
39
Hi there.

Is there a way to make IFERROR(x, t) return a "t" result that would ignored by AVERAGE()?

I tried this: AVERAGE(IFERROR(x, ""), IFERROR(y, "")), but unfortunately this doesn't work as expected. There is a subtle difference between inputting "" to the AVERAGE() function and referencing a blank cell...

If there is no direct solution, is there a somewhat indirect -yet simple- approach? I tried to play with AGGREGATE() or AVERAGEIF(), but I couldn't find a proper answer.

Thanks in advance for your help!

PS: "x" and "y" are actually long expressions, I'd rather not duplicate them in the formula. I also would like to proceed in one single step (one formula, no intermediate cell).
 
=IFERROR(SUM(IFERROR(x,0),IFERROR(y,0))/COUNT(x,y),"")
Yup, I thought about that, this is certainly a tad more elegant than what I currently do, but I was trying to avoid repeating"x" and "y" which are fairly long VLOOKUP expressions.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Actually, Scott made me think that, when limited to two values, I could write:
=IFERROR(AVERAGE(IFERROR(x, y), IFERROR(y, x)), NA())

This doesn't answer my own question (since it repeats 'x' and 'y'), but there is a certain elegance to it! :sneaky:
 
Upvote 0
Back to this... Maybe I can ask the question in another way...

Any way to make an array from the output of discrete formulas? Something akin to { VLOOKUP(...); VLOOKUP(...) }?

If there is an answer to that, then I should be able to use AVERAGIF() to solve my little problem.
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,937
Members
449,196
Latest member
Maxkapoor

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