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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

mrshl9898

Well-known Member
Joined
Feb 6, 2012
Messages
1,951
Can you not have the range as =Sheet1!$F$5:$F$17? The formula will work
 

EFANYoutube

Active Member
Joined
May 19, 2017
Messages
278
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)
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
20,878
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
Why not include the blank cells in the range so it's not non contigious??
 

CrazyBritGuy

New Member
Joined
Dec 10, 2019
Messages
13
Office Version
  1. 2016
Platform
  1. Windows

ADVERTISEMENT

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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,236
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

You can use named ranges as you have done, but some functions will not work on non-contiguous ranges.
 

CrazyBritGuy

New Member
Joined
Dec 10, 2019
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
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.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,236
Office Version
  1. 365
Platform
  1. Windows
I already have. Hence post#7 ;)
 

Forum statistics

Threads
1,141,043
Messages
5,703,917
Members
421,321
Latest member
blusky4

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
Top