1 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

VStack in formula returning an incorrect Empty Array Error?

Effectively what I'm trying to do is an AverageIf formula across worksheets (which obviously doesn't work). I want to take cell C9 in all sheets between InitPage:EndPage where the value is not 0. In the past I did that similar to the formula I have, which is the following -

=LET(targetdata,VSTACK(InitPage:EndPage!C9),AVERAGE(FILTER(targetdata, targetdata="<>0")))

What's odd is this is now returning a #CALC! error saying "Empty Array" where the VSTACK(InitPage:EndPage!C9) portion will result in an error.

However, when I test by writing just =VSTACK(InitPage:EndPage!C9) in a nearby test cell I get

0

.166

.168

0

0

0

0

0

0

0

Ideally in this case the result would be .167 as the average of .166 and .168 is .167, and all 0's would be ignored.

Testing =LET(TargetName,VSTACK(InitPage:EndPage!C9),TargetName) returns the same as the VSTACK alone, which makes me wonder about an issue with the rest of the formula?

Any thoughts as to why VSTACK would be returning empty only inside a formula? Or is something else wrong with my formula?

submitted by /u/Pax_Tech
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#AI formula generation techniques
#financial modeling with spreadsheets
#rows.com
#Excel compatibility
#google sheets
#Excel alternatives for data analysis
#VSTACK
#LET
#Empty Array
#AVERAGEIF
#FILTER
#Average
#CALC!
#C9
#InitPage
#EndPage
#Worksheet
#0
#Formula
#TargetName