Calculating averages when not in range and avoiding DIV/0

tommyturner

New Member
Joined
Jun 1, 2011
Messages
4
Hi

I am new to the power of Excel and am in need of some help! I have searched and read a number of similar problems but nothing quite matches or has worked for me, so I'm sorry if this a repetitive question!

I will set the scene. I have a sheet for each week of the year and each sheet has the days of the week in horizontal columns. Under each day there are a number of sub-columns with a different variable/category in each (10 in total). These variables are repeated every day.
So the first variable on Monday is the same first variable/category on Tuesday. They are therefore separated and not in continuous range.
All of the cells are blank until they will be filled with a number throughout the year. However in a number of cases, the cells will remain blank and won't be filled.

Therefore when calculating weekly averages for each category, the basic average formula returns DIV/0 which I want to avoid as I have yearly averages etc. Any other formulas I have tried say that there are too many arguements, presumably because the data is not continuous?

If someone could help me with a formula that will calculate an average from cells which are in some cases blank and not in continuous range, I would be extremely grateful!

Many thanks

Tom
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi, welcome to the board.

I think the basic AVERAGE() function will only return a DIV/0 error if ALL the cells are empty. If a single one contains a value and all the others are blank, you won't get a DIV/0 error. Does this help you get round the problem ?

If not, a quick and dirty way is to do something like this -
Code:
=if(iserror(YOURAVERAGEFUNCTION),"",YOURAVERAGEFUNCTION)
 
Upvote 0
Hi

I am new to the power of Excel and am in need of some help! I have searched and read a number of similar problems but nothing quite matches or has worked for me, so I'm sorry if this a repetitive question!

I will set the scene. I have a sheet for each week of the year and each sheet has the days of the week in horizontal columns. Under each day there are a number of sub-columns with a different variable/category in each (10 in total). These variables are repeated every day.
So the first variable on Monday is the same first variable/category on Tuesday. They are therefore separated and not in continuous range.
All of the cells are blank until they will be filled with a number throughout the year. However in a number of cases, the cells will remain blank and won't be filled.

Therefore when calculating weekly averages for each category, the basic average formula returns DIV/0 which I want to avoid as I have yearly averages etc. Any other formulas I have tried say that there are too many arguements, presumably because the data is not continuous?

If someone could help me with a formula that will calculate an average from cells which are in some cases blank and not in continuous range, I would be extremely grateful!

Many thanks

Tom

Use the AVERAGEA function, it won't count empty, blank or text cells

Code:
=AVERAGEA(...,...,etc)

:)
 
Upvote 0
Hi

I am new to the power of Excel and am in need of some help! I have searched and read a number of similar problems but nothing quite matches or has worked for me, so I'm sorry if this a repetitive question!

I will set the scene. I have a sheet for each week of the year and each sheet has the days of the week in horizontal columns. Under each day there are a number of sub-columns with a different variable/category in each (10 in total). These variables are repeated every day.
So the first variable on Monday is the same first variable/category on Tuesday. They are therefore separated and not in continuous range.
All of the cells are blank until they will be filled with a number throughout the year. However in a number of cases, the cells will remain blank and won't be filled.

Therefore when calculating weekly averages for each category, the basic average formula returns DIV/0 which I want to avoid as I have yearly averages etc. Any other formulas I have tried say that there are too many arguements, presumably because the data is not continuous?

If someone could help me with a formula that will calculate an average from cells which are in some cases blank and not in continuous range, I would be extremely grateful!

Many thanks

Tom
If you're using Excel 2007 or later try something like this...

=IFERROR(AVERAGE(...),"")

Fill in the details of the average function.
 
Upvote 0
Many thanks for the replies everybody!

In my case both Barry and T. Valko's solutions worked for me. The basic average function does leave div/0 when many of the cells will be blank for some weeks but thanks anyway jdmc45. Gerald your solution returned the all too familiar 'too many arguements' but thanks for the idea.

Again thanks ever so much for your help, you will probably hear from me again!!

Tom
 
Upvote 0
I realize it is already answered, but here is another approach

=IF(C1:C12<>"",AVERAGE(C1:C12),"")

the range to average is c1 to c12
 
Upvote 0
Many thanks for the replies everybody!

In my case both Barry and T. Valko's solutions worked for me. The basic average function does leave div/0 when many of the cells will be blank for some weeks but thanks anyway jdmc45. Gerald your solution returned the all too familiar 'too many arguements' but thanks for the idea.

Again thanks ever so much for your help, you will probably hear from me again!!

Tom
You're welcome. Thanks for the feedback! :cool:
 
Upvote 0

Forum statistics

Threads
1,215,473
Messages
6,125,018
Members
449,203
Latest member
tungnmqn90

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