Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 707

Modifying a Complicated Map Formula to put in Header

$
0
0

I've got a complicated formula that I don't understand:

=map(A2:index(A:A,match(,0/(A:A<>""))),lambda(Σ,if(Σ="",,map(BZ1:CW1,lambda(Λ,let(x,index(sumifs('Ref4'!Q:Q,'Ref4'!G:G,Σ,--'Ref4'!P:P,">="&Λ,--'Ref4'!P:P,"<"&if(day(Λ)=1,offset(Λ,,1),eomonth(Λ,)))),if(x=0,,x)))))))

that is used to solve the problem described here: Arrayformula to SUM matching ID AND when date is between two dates

However, I would like to put this formula in a header because I'm constantly doing an advanced sort of the data (Data-->Sort Range--->Advanced Range Sorting Options) in the the sheet, which would move the location of this formula and therefore, mess up its calculations.

An example for an entirely different array formula I've used as a header in the past would look something like:

={"Total Harvest kg"; ARRAYFORMULA(SUMPRODUCT(('Ref4'!$G$2:$G = TEXT($A$2:$A, "0")) * 'Ref4'!$Q$2:$Q))}

When I tried:

={"Don't Delete";map(A2:index(A:A,match(,0/(A:A<>""))),lambda(Σ,if(Σ="",,map(BZ1:CW1,lambda(Λ,let(x,index(sumifs('Ref4'!Q:Q,'Ref4'!G:G,Σ,--'Ref4'!P:P,">="&Λ,--'Ref4'!P:P,"<"&if(day(Λ)=1,offset(Λ,,1),eomonth(Λ,)))),if(x=0,,x))))))) }

I get the error : #VALUE! In ARRAY_LITERAL, an Array Literal was missing values for one or more rows.

Ideally I could put this header/formula in BY1 or BZ1. If it is in BZ1 the header would still need to be the same date "01/01/24"Here is the sheet: https://docs.google.com/spreadsheets/d/1k6nyu3xh0sLvbWjJ_vValAklzeTy72fvv3Cp0pEo--Y/edit?usp=sharing


Viewing all articles
Browse latest Browse all 707

Trending Articles



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