Average If one criteria across multiple columns ignoring blank cells in the column to be averaged

Fazila

Board Regular
Joined
Nov 19, 2014
Messages
163
Hi

I posted in an older thread as it helps with part of my problem but not sure if that is the right thing to do. The formula I used is from thread https://www.mrexcel.com/forum/excel...rageif-single-criterion-multiple-columns.html i.e. =SUMPRODUCT(('Updated Options'!$M$2:$P$297=A3)*('Updated Options'!$G$2:$G$297))/SUMPRODUCT(--('Updated Options'!$M$2:$P$297=A3))

However, this formula converts blank cells to having a value of 0 thus not giving a very accurate average. Is there anyway I can change the formula so it ignores blanks.

Thanks

Fazila
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
In that same link they put these formulas:


Jonmo1
=SUMPRODUCT((B2:E33=8)*(G2:G33))/SUMPRODUCT((B2:E33=8)*(G2:G33<>0))

And

Aladin Akyurek
=AVERAGE(IF(B2:E33=8,IF(ISNUMBER(G2:G33),G2:G33)))
 
Upvote 0
In that same link they put these formulas:


Jonmo1
=SUMPRODUCT((B2:E33=8)*(G2:G33))/SUMPRODUCT((B2:E33=8)*(G2:G33<>0))

And

Aladin Akyurek
=AVERAGE(IF(B2:E33=8,IF(ISNUMBER(G2:G33),G2:G33)))

Whoops should have read the thread properly the Jonmo1 formula returned a different result to what I was expecting but Aladin Akyurek's formula worked great.

Thanks DanteAmor for pointing it out.
 
Upvote 0
Whoops should have read the thread properly the Jonmo1 formula returned a different result to what I was expecting but Aladin Akyurek's formula worked great.

Thanks DanteAmor for pointing it out.


I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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