Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How to combine ARRAYFORUMLA with INDIRECT to iterate over multiple sheets in Google Sheets?

$
0
0

I have an expenses spreadsheet that has a sheet tab for each month with a breakdown of expenses of items paid by 'X' person. The main sheet searches all month sheets manually to combine all expenses paid by 'X' person, and does some additional calculations with that data, ex.:

=sum(IFNA(filter('Oct. Expenses'!$D$4:$D$100, regexmatch('Oct. Expenses'!$C$4:$C$100, F9)),0), IFNA(filter('Nov. Expenses'!$D$4:$D$100, regexmatch('Nov. Expenses'!$C$4:$C$100, F9)),0),IFNA(filter('Dec. Expenses'!$D$4:$D$100, regexmatch('Dec. Expenses'!$C$4:$C$100, F9)),0),IFNA(filter('Jan. Expenses'!$D$4:$D$100, regexmatch('Jan. Expenses'!$C$4:$C$100, F9)),0),IFNA(filter('Feb. Expenses'!$D$4:$D$100, regexmatch('Feb. Expenses'!$C$4:$C$100, F9)),0))

Over time this has become tedious as this formula is similarly used in several places with different parameters, and every month a new line needs to be added to them. I want to make this more efficient by defining a coloumn with all sheet names in (i.e. coloumn 'L') and iterating through them as arguments passed into the formula, something like this:

=sum(ARRAYFORMULA(filter(INDIRECT(L1&"!$D$4:$D$100"), regexmatch(INDIRECT(L1&"!$C$4:$C$100"), $F$9))))

This works for a single value, but the ARRAYFORMULA doesn't recognize changing L1 into an array like L1:12. What am I missing?


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>