# Average if range not blank

1. ## Average if range not blank

Hello, quick question please could you tell me how to average a range if range not blank. If range is blank then I would like to return a blank.
many thanks,
A

2. ## Re: Average if range not blank

You could do something like this
Formula:
`Please Login or Register  to view this content.`

3. ## Re: Average if range not blank

Or maybe:
``Please Login or Register  to view this content.``

4. ## Re: Average if range not blank

Many thanks, both.
A

5. ## Re: Average if range not blank

And a follow up question if I may. I am averaging a range that is populated via index match. the formula I am using is an array like this:

=IFNA(INDEX(J10:J13,MATCH(\$A\$13:\$A\$16,\$H\$10:\$H\$13,0)),"")

How do I prevent the average function I am using (thanks Willem) calculating on the blank "". At present it is counting the empty cells as 0.
Many thanks,
A

6. ## Re: Average if range not blank

To ignore 0 (zero), try: =IF(COUNT(A1:A10)=0,"",AVERAGEIF(A1:A10,"<>0"))

There are currently 1 users browsing this thread. (0 members and 1 guests)