AVERAGEPRODUCT? - Episode 1199

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Apr 7, 2010.
Susan asks..."I have been using SUMPRODUCT a lot ever since you showed me how since I cant use SUMIFS for users with pre-2007 version. But, is there an AVERAGEPRODUCT or something similar? How about MAXPRODUCT?"
maxresdefault.jpg


Transcript of the video:
The MrExcel podcast is brought to you by “Easy-XL”!
Hey, welcome back to the MrExcel netcast, I'm Bill Jelen.
Now today's question sent in by Susan, Susan had been in the Data Analyst Boot Camp, that's the seminar that Mike Alexander and I do twice a year.
Now the next one of these is coming up May 18th and 19th 2010 in Chicago.
Susan said “Hey, I've been using SUMPRODUCT ever since the boot camp, I love it.
I know that SUMIFS could do what I need to do, but I have to share this workbook with people at a customer site who's still using Excel 2003, so I can't use SUMIFS.” But she said “Alright, SUMPRODUCT is great, but I want ‘AVERAGEPRODUCT’ or ‘MAXPRODUCT’.
I want to do what AVERAGEIFS could do, or what, in theory, MAXIFS would do if there was such a thing.” And so, I'm going to build kind of a little formula here.
Now I'm going to start out with a formula, it's not going to work, I'm going to say =IF.
And I want to look through column A over here, and I'll press F4 to lock that down and say “Is that equal to this A here in column E?” So, that's equal, then what I want is, I want the corresponding number from column B, and again press F4 to lock that down.
If it's not equal, I'm going to put “”. Alright, now why “”? Well, the AVERAGE function is a clever function that will average all of the numeric values, but ignore text values.
So what's happening here is, any time that I get an A. I'm going to have that number, anytime that I have anything else, I'm going to get text.
And then if I could somehow average to this whole array of numbers, it will only average the ones that match(?).
Clever, huh?
Alright, so this formula that I have right here will never work, you have to use something called a wrapper function.
A wrapper function says “Hey, we're going to take that array of numbers and aggregate it somehow, either using SUM or AVERAGE or MAX or MIN.” So I'll use here AVERAGE().
Now, because that is an array, we have to do Ctrl+Shift, I hold down Ctrl+Shift and press Enter, and it does the math, when I copy that down it works beautifully.
So, those are the AVERAGE of all the cells.
Now if I was looking for the largest, that's one of things that Susan had mentioned, what we could use MAX instead of AVERAGE.
Again Ctrl+Shift+Enter, make sure you do just one of those at a time, MAX, Ctrl+Shift+Enter, and now copy that down to our other cells, and there's the largest value.
So even though SUMPRODUCT won't do it, you can use any kind of a wrapper function around that IF statement to check it out.
So I want to thank Susan for sending that question in, want to invite you down to the next Data Analyst Boot Camp.
You know, I think I'm the funniest Excel guy there is, but Mike Alexander is pretty funny too, and there's a lot of fun.
Couple of days out there, Mike half the day, me half the day, you'll learn a lot about Excel.
Hey, I want to thank you for stopping by, we'll see you next time for another netcast from MrExcel!
 

Forum statistics

Threads
1,223,702
Messages
6,173,961
Members
452,539
Latest member
delvey

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