Hello,
I was playing with the general array syntax, i.e. ={}, and I realized that it only accepts elements of the main data types: numbers, texts, logicals, blanks, and errors, as follows:
={1,2,3}
={"a","b","c"}
={"","",""}
={TRUE,FALSE,TRUE}
={#DIV/0!,#N/A,#REF!}
={12,"book","",TRUE,#DIV/0!}
However, when I tried to input arrays of expressions as below, I couldn't ENTER them:
={A1,A2,A3}
={A1:B5,C3:C6}
={B2:B7*5,C6:D8/2}
etc.
Is it possible to write arrays like this?
The reason I thought about this was that I was thinking to create a LAMBDA such that it would do a particular operation based on whether the input reference is a number, text, blank, logical, or error based on this same exact index order, "number, text, blank, logical, error". But I don't want to include five extra parameters for my LAMBDA. I just want to include all five actions in one parameter like this:
=XXXX(reference,value_if_types)
where the user would write something like this:
=XXXX(A1:G1,{A1:G1*5,"",0,"",100})
which means if A1:G1 is number, multiply them by 5, if A1:G1 is text, return blank, if A1:G1 is blank, return 0, if A1:G1 is logical, return blank, and if A1:G1 is error, return 100.
So another (less specific) way of asking my question would be: Is it possible to condense a few parameters into one? (whether in the {} syntax or any other syntax)
Thanks for any input!
I was playing with the general array syntax, i.e. ={}, and I realized that it only accepts elements of the main data types: numbers, texts, logicals, blanks, and errors, as follows:
={1,2,3}
={"a","b","c"}
={"","",""}
={TRUE,FALSE,TRUE}
={#DIV/0!,#N/A,#REF!}
={12,"book","",TRUE,#DIV/0!}
However, when I tried to input arrays of expressions as below, I couldn't ENTER them:
={A1,A2,A3}
={A1:B5,C3:C6}
={B2:B7*5,C6:D8/2}
etc.
Is it possible to write arrays like this?
The reason I thought about this was that I was thinking to create a LAMBDA such that it would do a particular operation based on whether the input reference is a number, text, blank, logical, or error based on this same exact index order, "number, text, blank, logical, error". But I don't want to include five extra parameters for my LAMBDA. I just want to include all five actions in one parameter like this:
=XXXX(reference,value_if_types)
where the user would write something like this:
=XXXX(A1:G1,{A1:G1*5,"",0,"",100})
which means if A1:G1 is number, multiply them by 5, if A1:G1 is text, return blank, if A1:G1 is blank, return 0, if A1:G1 is logical, return blank, and if A1:G1 is error, return 100.
So another (less specific) way of asking my question would be: Is it possible to condense a few parameters into one? (whether in the {} syntax or any other syntax)
Thanks for any input!