HLOOKUP averaging blank cells

boolavka

New Member
Joined
Oct 1, 2014
Messages
3
Hi,


I am trying to calculate the average of values returned by hlookup. The problem is that some of dataranges have columns with blank cells. For some reason excel counts those blank cells and skews my average.

=AVERAGE(HLOOKUP(C3,data_range1,3,FALSE),(HLOOKUP(C3,data_range2,3,FALSE)),(HLOOKUP(C3,data_range3,3,FALSE)))

Please help me to figure out how to go about it w/o complicating too much.

Thx.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Try this:

Code:
=(HLOOKUP(C3,data_range1,3,0)+HLOOKUP(C3,data_range2,3,0)+HLOOKUP(C3,data_range3,3,0))/(HLOOKUP(C3,data_range1,3,0)<>0+HLOOKUP(C3,data_range2,3,0)<>0,HLOOKUP(C3,data_range3,3,0)<>0)
 
Upvote 0
Try this:

Code:
=(HLOOKUP(C3,data_range1,3,0)+HLOOKUP(C3,data_range2,3,0)+HLOOKUP(C3,data_range3,3,0))/(HLOOKUP(C3,data_range1,3,0)<>0+HLOOKUP(C3,data_range2,3,0)<>0,HLOOKUP(C3,data_range3,3,0)<>0)

Thank you.

Nope, unfortunately doesn`t work.
 
Upvote 0
Platonic, I tried again, just added parenthesis around each hlookup and it worked. You are a genius! Thank you so much.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

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