How to make AVERAGE function ignore blank cells that are the result of LOOKUP?

neiljuk

New Member
Joined
Nov 26, 2015
Messages
1
Hi guys,

I'm a total newbie and looking for some help for a spreadsheet I'm trying to make for work.

It's a scorecard and I need to get the average value of 8 cells in one row, where each cell contains text apart from one which contains a number. So I'm using LOOKUP where No = 0 and Yes = 100. This works fine when there is Yes or No in each of the cells, however on some rows I only want the average of 5 cells, and do not want it to average cells containing N/A.

My formula (there is probably a far more efficient way of doing this, but that's beyond me)

=AVERAGE(LOOKUP(B3,{"No","Yes"},{"0","100"}),LOOKUP(D3,{"No","Yes"},{"0","100"}),E3,LOOKUP(F3,{"No","Yes"},{"0","100"}),LOOKUP(G3,{"No","Yes"},{"0","100"}),LOOKUP(H3,{"No","Yes"},{"0","100"}),LOOKUP(I3,{"N/A","No","Yes"},{"","0","100"}),LOOKUP(J3,{"N/A","No","Yes"},{"","0","100"}),LOOKUP(K3,{"N/A","No","Yes"},{"","0","100"}))

I hoped that by having LOOKUP see N/A as a blank cell it would ignore it, but it does not.

B3, D3, F3, G3, and H3 are drop down boxes with the options of Yes and No
E3 is a value between 0-100

I3, J3, K3 are drop down boxes with the options of Yes, No and N/A

This works perfectly as long as N/A isn't selected for a cell, but I get a #VALUE! error when N/A is selected. When I click show calculation steps, it looks like the formula is struggling to divide by a blank cell.


Any help would be greatly appreciated!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
if you have 2010 onwards then have a look at AGGREGATE and its options
 
Upvote 0
Hi,

For Excel 2007 you can try

=(COUNTIF(B3:K3,"Yes")*100)+(COUNTIF(B3:K3,"No")*0)+(E3)/(COUNTA(B3:K3)-SUMPRODUCT((--ISNA(B3:K3))))
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,849
Members
449,096
Latest member
Erald

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