IF OR problem

wadeer

New Member
Joined
Dec 14, 2017
Messages
7
I have a range of cells that are presently unpopulated. I will populate these cells over time. I want to have this range produce an average. I repeat several ranges after the first range and eventually get an average of all the ranges together. If I use the formula =average(B8:G8) I get #DIV/)! because all the cells in that range are unpopulated. I also get that same message for the future ranges which effects the average of all ranges. When I populate any cell in the first range the formula works but not for all the ranges until they are populated as well. So I used this formula =IF(OR(B8:G8)="","",Average(B8:G8)). I was hoping I would get a blank result if all the cells were unpopulated but I get #VALUE! so my running average is still affected. so my basic question is why isn't the cell containing the second formula not giving me the desired empty cell look until a cell in the range is populated?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
give this a shot:
Excel Formula:
=IFERROR(average(B8:G8), "")
 
Upvote 0
Solution
It is because this is not a valid calculation:
Excel Formula:
OR(B8:G8)=""
You can not check a whole range of cells like that.
You could use:
Excel Formula:
=IF(COUNT(B8:G8)=0,"",Average(B8:G8))
But I think it is easier to just use IFERROR to handle the errors, as shown in the previous post.
 
Upvote 0
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

So I used this formula =IF(OR(B8:G8)="","",Average(B8:G8)). I was hoping I would get a blank result if all the cells were unpopulated
You could also try this variation of your attempt
Excel Formula:
=IF(AND(B8:G8=""),"",AVERAGE(B8:G8))
 
Upvote 0
It is because this is not a valid calculation:
Excel Formula:
OR(B8:G8)=""
You can not check a whole range of cells like that.
You could use:
Excel Formula:
=IF(COUNT(B8:G8)=0,"",Average(B8:G8))
But I think it is easier to just use IFERROR to handle the errors, as shown in the previous post.
thank you for your response
 
Upvote 0

Forum statistics

Threads
1,215,217
Messages
6,123,673
Members
449,116
Latest member
HypnoFant

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