average(sumproduct...issue

bluepenink

Well-known Member
Joined
Dec 21, 2010
Messages
585
Hello

i tried using this to find the average.....but it's not working....not sure at all why

=AVERAGE(SUMPRODUCT(--('Chicago - Data'!$A$2:$A$3640=Illinois!$BM$4),--('Chicago - Data'!$E$2:$E$3640=Illinois!$BL$4),INDEX('Chicago - Data'!$F$2:$K$3640,0,MATCH(Illinois!BL$5,'Chicago - Data'!$F$1:$K$1,0))))

any idea? thx u
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try this instead:

=AVERAGE(--('Chicago - Data'!$A$2:$A$3640=Illinois!$BM$4)*--('Chicago - Data'!$E$2:$E$3640=Illinois!$BL$4)*INDEX('Chicago - Data'!$F$2:$K$3640,0,MATCH(Illinois!BL$5,'Chicago - Data'!$F$1:$K$1,0)))

Confirm with Ctrl+Shift+Enter instead of Enter.


If this doesn't work, could you provide some data examples and an example of a desired result?
 
Upvote 0
hello

thxs for the prompt response!

when i do a manual check, im getting approx $4,135
the formula you provided gives me $1,824

basically, im trying to sum up data for "chicago" by period (month) and by invoice type (auto, purge).

this is my formula for that:

=SUMPRODUCT(--('Chicago - Data'!$A$2:$A$3640=Illinois!$BM$4),--('Chicago - Data'!$E$2:$E$3640=Illinois!$BL$4),INDEX('Chicago - Data'!$F$2:$K$3640,0,MATCH(Illinois!BL$5,'Chicago - Data'!$F$1:$K$1,0)

so i figured, i can just insert in , average and it will do the same job....any suggestions?

details:
'Chicago - Data'!$A$2:$A$3640=Illinois!$BM$4 > name range "chicago"

'Chicago - Data'!$E$2:$E$3640=Illinois!$BL$4 > name range of invoice "auto"

'Chicago - Data'!$F$2:$K$3640 > columns that contain the invoice amounts $

MATCH(Illinois!BL$5,'Chicago - Data'!$F$1:$K$1,0 > contains month Jan 11, Feb 11 etc

thxs buddy!
 
Upvote 0
hey buddy

this works

=AVERAGEIF('Chicago - Data'!$A$2:$A$3640,Illinois!$BM$4,INDEX('Chicago - Data'!$F$2:$K$3640,0,MATCH(Illinois!BL$5,'Chicago - Data'!$F$1:$K$1,0)))

but i need to be able to filter by "invoice type"

so is there a way to integrate this into the formula (the line below)?

'Chicago - Data'!$E$2:$E$3640=Illinois!$BL$4 ...> contains invoice type "auto" or "purge"

thx u!
 
Upvote 0
Does this work?

=average(if('Chicago - Data'!$A$2:$A$3640=Illinois!$BM$4,if('Chicago - Data'!$E$2:$E$3640=Illinois!$BL$4,INDEX('Chicago - Data'!$F$2:$K$3640,0,MATCH(Illinois!BL$5,'Chicago - Data'!$F$1:$K$1,0)))))

Confirm with CSE.


Since you already have the sum of the relevant items, if you divide that by the number of relevant items you'll get the average. So it's:

=SUMPRODUCT(--('Chicago - Data'!$A$2:$A$3640=Illinois!$BM$4),--('Chicago - Data'!$E$2:$E$3640=Illinois!$BL$4),INDEX('Chicago - Data'!$F$2:$K$3640,0,MATCH(Illinois!BL$5,'Chicago - Data'!$F$1:$K$1,0)/countifs(--('Chicago - Data'!$A$2:$A$3640),Illinois!$BM$4,--('Chicago - Data'!$E$2:$E$3640),Illinois!$BL$4)

I hope that either of those should get the result you're looking for.
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,787
Members
452,942
Latest member
VijayNewtoExcel

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