Averageif of cells from three sheets

KMK_79

New Member
Joined
Sep 24, 2017
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I have a workbook with four sheets.

All sheets have the same row:column format and relative references, as below

1722601670824.png


The three sheets have unique names and raw data reports. This fourth sheet is trying to do an average of all three data reports (i.e. cell B2 from all three sheets), provided they are non-zero and non-blank).

I've spent a few hours searching how to achieve AVERAGEIF conditional lookups and the only relevant one I found was related to sumproduct of doing sumifs/countifs. See formula written below:

=SUMPRODUCT(SUMIF(INDIRECT("'"&{"Sheet1","Sheet2","Sheet3"}&"'!B2"),"<>0"))/SUMPRODUCT(COUNTIF(INDIRECT("'"&{"Sheet1","Sheet2","Sheet3"}&"'!B2"),"<>0"))

The problem is when I copy this formula past cells B2 to B3 and C2 across the relative references do not change. Please help!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thanks for that. (y)
if your 3 sheets are consecutive, you can use
Excel Formula:
=LET(v,VSTACK(Sheet1:Sheet3!B2),AVERAGE(FILTER(v,v<>0)))
 
Upvote 0
Interesting - did not yield any result but gave me a #CALC! error

What does that relate to?
 
Upvote 0
That suggests that none of the B2 cells have a value other than blank or 0
 
Upvote 0
THANK YOU @Fluff

I dragged the formula across the tables and IT WORKED!

Thank you so much - really appreciate it.

Now for the rationale - I can't make out LET and VSTACK functions - can you direct me to appropriate tools to read up how to structure such formulas please?
 
Upvote 0

Forum statistics

Threads
1,224,809
Messages
6,181,075
Members
453,020
Latest member
mattg2448

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