Jun 17 2022 09:39 AM
I am trying to get the minimum value in an array that is generated using a formula. I would like to do this in one cell using MAKEARRAY, something like "=MIN(MAKEARRAY(10,1,LAMBDA(a,b,IFERROR(IF(a="","",@INDEX(T_ASSETS[STARTING QUANTITY],$B$2)+SUMIFS(T_ADDRET[QUANTITY],T_ADDRET[TYPE],"Add",T_ADDRET[EFFECTIVE DATE],"<="&a,T_ADDRET[ASSET ID],$C$2)),""))))", but any array made like this doesn't work within other functions. Is there any way to get this formula workable?
Jun 17 2022 10:44 AM
Jun 17 2022 01:12 PM
Jun 17 2022 01:57 PM
Jun 17 2022 02:04 PM
Jun 17 2022 02:04 PM
Jun 17 2022 02:06 PM
Jun 17 2022 02:11 PM
Jun 17 2022 02:27 PM
Jun 17 2022 02:53 PM
Jun 17 2022 02:56 PM
Jun 17 2022 03:00 PM
Jun 17 2022 03:04 PM - edited Jun 17 2022 03:05 PM
Yes. Half of the formula is cropped out to make it easier to read.
I didn't actually try it on that formula because I am still missing some of the data it's being used on, so I was playing around to try and build as much of the formula as I could, and the first thing I tried was:
=MIN(MAKEARRAY(10,1,LAMBDA(a,b,a)))
which gave me an error, so I didn't even bother trying the whole thing. Being that it is a more complex formula I assume that it won't be an issue in this case.
Thanks for your help.
Jun 17 2022 04:29 PM
It looks like another auto-lifting issue with lambdas.
=MIN( 0 + MAKEARRAY(10,1, LAMBDA(a,b,a) ) )
also works.
Jun 17 2022 06:15 PM
Jun 18 2022 04:00 AM
More about auto-lifting is here Yellow (lambdadays.org), "Auto-lifting/coercion" slide.
Usually it doesn't work in combination of some "old" functions and dynamic arrays, for example
Sometimes with named formulae. To force it, if reference adding of plus +range helps, if an array add something to it as here with +0