3D Array Formula - Is it Possible?

krame00

New Member
Joined
Oct 6, 2002
Messages
39
Before I waste any more time on this - is it possible for an Array formula to be 3D? I am having no success, and I have heard it is - if you know how to do it right...

I tried searching the forum, but got too many hits to weed though - so if anyone has a quick answer that would be helpful.

Thanks!

Khana
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Yeah - thanks - I saw that one, too. But I do not think it solves my question... unless it is way over my head or something. I don't know if it applies.
 
Upvote 0
Sure. I would like to do a 3D averageif array formula that averages all of the cells in A1 for all of the sheets in the workbook. I want to average only those cells that are not zero.

Does that make sense?

Khana
 
Upvote 0
Sure. I would like to do a 3D averageif array formula that averages all of the cells in A1 for all of the sheets in the workbook. I want to average only those cells that are not zero.

Does that make sense?

Khana

List your worksheets name in cell A2:A10

=AVERAGE(IF(N(INDIRECT("'"&A2:A10&"'!A1"))<>0,N(INDIRECT("'"&A2:A10&"'!A1"))))


Hope it helps!
 
Upvote 0
Another try, with VBA: this sub would sum up the values and average them. I think it is not possible to group sheets in code, so you have to loop through the sheets. In Excel, you could just use a formula like =AVERAGE(SUM(Sheet1:Sheet10!A1)) and this would average Sheet1 to Sheet10 cells A1 (i.e., those two and all sheets in between). It would not add in text but would count zeros in the average.

I'd be interested in your 3D array if you get that working.

Code:
Sub AddA1Cells()
Dim ws As Worksheet, sumCells As Double, countCells As Double

For Each ws In Worksheets
    With ws
    If IsNumeric(.Cells(1, 1)) Then
        If .Cells(1, 1) <> 0 Then
            sumCells = sumCells + .Cells(1, 1).Value
            countCells = countCells + 1
        End If
    End If
    End With
Next ws

ActiveCell.Value = sumCells / countCells

End Sub
 
Upvote 0
Here's another way...

1) Download and install the free add-in Morefunc.xll

2) Create two new sheets and name them First and Last

3) Place all relevant sheets between First and Last

4) Then try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...

=AVERAGE(IF(THREED('First:Last'!A1)>0,THREED('First:Last'!A1))

Hope this helps!
 
Upvote 0
Hi,
by playing a little bit around what about this little funny formula:

STUPID IDEA edited

=SUM(Sheet1:Sheet5!A1)/SUM(FREQUENCY(Sheet1:Sheet5!A1,{0}))

Where Sheet1 is first sheet and Sheet5 is last sheet.
If all values could be zero then it hast to be checked first if sum(frequency ... equals 0)
 
Upvote 0

Forum statistics

Threads
1,216,030
Messages
6,128,405
Members
449,448
Latest member
Andrew Slatter

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