Mar 16 2023 09:39 PM - edited Mar 16 2023 09:40 PM
Hi guys,
I've tried with the following formula to make a blank array but in vain
=LET(x,MAKEARRAY(2,2,LAMBDA(r,c,"")),ISBLANK(x))
So what should I return in the LAMBDA to make the x a blank array? Many thanks!
Mar 16 2023 10:44 PM
@yushang An empty string like "" does not equal a blank. That why you get FALSE. Turn it into this:
=LET(x,MAKEARRAY(2,2,LAMBDA(r,c,"")),x="") to get all TRUE.
Mar 17 2023 09:32 AM
Formulae in Excel, includes lambdas, do not return into the grid blank as a value. You may return zero by default (formatted as FALSE in your case), or empty string "", or any other value. Not blank.
Mar 18 2023 04:15 PM
Within the LET formula try replacing the double quotes with IF(,,) or SORT(,) to return an array of TRUE values. For this purpose, it may be helpful to define names:
missing:=IF(,,)
empty:=@SORT(,)
I find nulls particularly confusing in Excel. Although they are displayed as zeroes in formula results, depending on context they may also result in "" or FALSE. Formula debugging really needs to be improved in my view.
Mar 19 2023 01:00 AM
@Patrick2788 They are not the true blanks. ISBLANK(EXPAND("",2,2,"")) return {false,false;false,false}
Mar 19 2023 04:43 AM - edited Mar 19 2023 04:45 AM
@Patrick2788 I just want to use ISBLANK. I found 2 solutions
1. reference a blank cell, for example, A65536, which is far enough from occasionally modify.
2. do not use ISBLANK, instead, use NA() and ISNA() pair, this solution is more robust.
Mar 19 2023 05:01 AM
I had tried this same exercise to gain a better understanding of the formula language for building lambdas, since one often needs to account for null inputs. ISBLANK can be contrasted with ISOMITTED which returns a single FALSE value when given an array of blanks but does returns TRUE for the missing definition above.
Mar 19 2023 08:07 AM
From that point of view slightly modified initial formula
=LET(x, MAKEARRAY(2,2, LAMBDA(r,c, LAMBDA([n],n)() ) ), ISBLANK(x) )
returns all TRUE.
Still didn't catch what is the purpose.
Mar 19 2023 08:50 AM
Yes, I guess there are many variations, another for array of empty/missing values:
=LET(x,EXPAND(SORT(,),2,2,),ISBLANK(x))
Wrting unit tests for lambdas was the purpose for me as well as background knowledge. I think nulls can also be useful in data transformations to distinguish from other values like "" and NA() - the trouble is available formula tools make them difficult to work with.
Mar 21 2023 03:56 PM
SolutionBelow is an example of a data transformation using blank values within a pivoted array.
Note for display in the grid null strings are used:
MATRIX(row,col,val,"")
but for arithmetic calculations, blank values are used instead::
MATRIX(row,col,val)
Mar 21 2023 06:39 PM - edited Mar 21 2023 06:43 PM
@lori_m Thanks. SORT(,) is the point which return true blank!
BTW I found SORTBY(,) also works.