How to use non-contiguous named range in AVERAGEIF function

CrazyBritGuy

New Member
Joined
Dec 10, 2019
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
The syntax for AVERAGEIF states:
Range Required. One or more cells to average, including numbers or names, arrays, or references that contain numbers.

But when I create a named range nonContig as =Sheet1!$F$5:$F$10,Sheet1!$F$13:$F$17

2021-02-07 19_19_53-.png


and in cell G3 enter =AVERAGEIF(noncontig,"<10") I get #VALUE
2021-02-07 19_17_18-.png


What's wrong with me?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi CrazyBritGuy
I wonder why you need to seperate these ranges, this should work just fine because you are removing blanks using your criteria
Excel Formula:
=AVERAGEIF(F5:F17,">10",F5:F17)
 
Upvote 0
Why not include the blank cells in the range so it's not non contigious??
 
Upvote 0
Why not include the blank cells in the range so it's not non contigious??

Sorry, the example I used obfuscated the point I was assing about.

The point is that I trying to get is that on the Microsoft Support site: AVERAGEIF syntax definition

The AVERAGEIF function syntax has the following arguments:
  • Range Required. One or more cells to average, including numbers or names, arrays, or references that contain numbers.
  • Criteria Required. The criteria in the form of a number, expression, cell reference, or text that defines which cells are averaged. For example, criteria can be expressed as 32, "32", ">32", "apples", or B4.
  • Average_range Optional. The actual set of cells to average. If omitted, range is used.

states that "Names" (which I assume means "NAMED RANGES") can be used but when I use one it return the #VALUE error.

So, maybe my question s/b How do you use NAMED RANGES
 
Upvote 0
You can use named ranges as you have done, but some functions will not work on non-contiguous ranges.
 
Upvote 0
Hi CrazyBritGuy
I wonder why you need to seperate these ranges, this should work just fine because you are removing blanks using your criteria
Excel Formula:
=AVERAGEIF(F5:F17,">10",F5:F17)

See my reply to Michael M. response.
 
Upvote 0
I already have. Hence post#7 ;)
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,040
Members
448,543
Latest member
MartinLarkin

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