Ignoring Blanks on Average(IF

Stretlow

Board Regular
Joined
Dec 17, 2008
Messages
131
Hi there.

I have this formula

{=AVERAGE(IF(Data!B:B=G6,Data!L:L))}

but its including the blank cells in the average calculation.

My question is , is there something i can include to ignore these blank cells?

Many thanks in advance
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
How about
=AVERAGE(IF((data!B1:B35=G6)*(data!L1:L35<>""),data!L1:L35))

It's a bad idea to use whole column references in array formulae
 
Upvote 0
For the sake of performance avoid references to entire columns in array formulas - use definite ranges.
Maybe something like this
=AVERAGE(IF(Data!B2:B100=G6,IF(ISNUMBER(Data!L2:L100),Data!L2:L100)))
Ctrl+Shift+Enter

M.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
Thank you to you both they work... and further thanks for the advice on performance.

Stret

You're welcome.

By the way, since AVERAGEIF ignores blank cells you can use a regular formula
=AVERAGEIF(Data!B2:B100,G6,Data!L2:L100)

M.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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