"averageifs(indirect..." with named ranges

teatimecrumpet

Active Member
Joined
Jun 23, 2010
Messages
307
Hi,

I'm trying to use the formula below:

=AVERAGEIFS(INDIRECT("var1"),var2,"Y")


to average a column.

However, I'm getting "#value!" because some of the cells in the named range "var1" is "#value!" is there a way to modify the formula to avoid those cells (without removing them from the column of data".

Thanks,
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi,

I'm trying to use the formula below:

=AVERAGEIFS(INDIRECT("var1"),var2,"Y")


to average a column.

However, I'm getting "#value!" because some of the cells in the named range "var1" is "#value!" is there a way to modify the formula to avoid those cells (without removing them from the column of data".

Thanks,
If you're using Excel 2007 or later those aren't good named ranges since those are also valid cell addresses. Maybe use:

var1_
var2_

If the named ranges are dynamic ranges defined using functions like OFFSET then INDIRECT("range") won't work.

Try this array formula**:

=AVERAGE(IF(var2_="Y",IF(ISNUMBER(INDIRECT("var1_")),INDIRECT("var1_"))))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
Hi Valko,

Thanks that did the trick. I changed the named ranges to that for posting on the forum. But that is very useful to know.


Thanks Again!
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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