# help with AVERAGE problem

#### Dwise85

##### New Member
Hi,

I am trying to find the average in a column. If there is not data in that column I went to reference the data in another cell and use that as "the average" for that column. Any help would be greatly appreciated!

for example:
column 1 cells A1:A8 are averaged in A9, column 2 cells B1:B8 are averegd in B9, column C cells C1:C8 are averaged in C9 but all cells are blank and returing a #div/0!. if this is the case I want to use the data that is in E6 and and use that as the average if this is the case.

### Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

#### Dwise85

##### New Member
Hi,

I want to use the data that is in E6 and and use that as the average if this is the case.

sorry I want to use the data in h6 not e6 hopes the pic helps

#### jtakw

##### Well-known Member

Hi,

You can just wrap your formula with IFERROR:

=IFERROR(AVERAGEIF(D2:D8,"<>0"),H6)

#### Eric W

##### MrExcel MVP
Welcome to the forum.

Code:
``=IFERROR(AVERAGE(D2:D8),\$H\$6)``

AVERAGEIF may not be required, since AVERAGE ignores empty cells.

#### Dwise85

##### New Member

Awsome guys thanks heaps!

#### jtakw

##### Well-known Member
You're welcome, welcome to the forum.

#### Michael M

##### Well-known Member
So simply

Code:
``=AVERAGE(B2:B8)``

Replies
7
Views
40
Replies
0
Views
34
Replies
1
Views
47
Replies
4
Views
94
Replies
0
Views
55