无需 VBA 在 Excel 中组合动态数组
我在同一个电子表格中有两个动态数组,称为 Input
和 Length
:
Input
=TRANSPOSE(BASE(DEC2BIN(CODE(MID) (A1,(SEQUENCE(1,LEN(A1),,1)),1))),10,8))
长度
=TRANSPOSE(MID(BASE((LEN(A1)*8),2,64),SEQUENCE(1,8,,8),8))
Input Length
01010011 00000000
01101111 00000000
01101101 00000000
01100101 00000000
00100000 00000000
01100111 00000000
01110101 00000000
01101001 10110000
01100100
01100001
01101110
01100011
01100101
00100000
01101110
01100101
01100101
01100100
01100101
01100100
00100000
00100000
我想将它们组合成一个数组:
01010011
01101111
01101101
01100101
00100000
01100111
01110101
01101001
01100100
01100001
01101110
01100011
01100101
00100000
01101110
01100101
01100101
01100100
01100101
01100100
00100000
00100000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
10110000
我尝试使用的公式是:
=INDEX((Input,Length),SEQUENCE(ROWS(Input)+ROWS(Length)))
但是 Length
范围正在生成 #REF!
错误,我无法解决:
01010011
01101111
01101101
01100101
00100000
01100111
01110101
01101001
01100100
01100001
01101110
01100011
01100101
00100000
01101110
01100101
01100101
01100100
01100101
01100100
00100000
00100000
#REF!
#REF!
#REF!
#REF!
#REF!
#REF!
#REF!
#REF!
我尝试使用其他函数无法组合数组,和/或生成各种其他 #NUM!
和 #VALUE!
错误。
我还将顺序从 Input
,Length
交换为 Length
,Input
,这会生成相同的 第二个数组的 #REF!
错误。
我怀疑我已经看它太久了,只是需要新的眼光。
我想使用本机 Excel 函数和公式,而不是 VBA 或其他编程方法。
I have two dynamic arrays in the same spreadsheet, called Input
and Length
:
Input
=TRANSPOSE(BASE(DEC2BIN(CODE(MID(A1,(SEQUENCE(1,LEN(A1),,1)),1))),10,8))
Length
=TRANSPOSE(MID(BASE((LEN(A1)*8),2,64),SEQUENCE(1,8,,8),8))
Input Length
01010011 00000000
01101111 00000000
01101101 00000000
01100101 00000000
00100000 00000000
01100111 00000000
01110101 00000000
01101001 10110000
01100100
01100001
01101110
01100011
01100101
00100000
01101110
01100101
01100101
01100100
01100101
01100100
00100000
00100000
I want to combine them into a single array:
01010011
01101111
01101101
01100101
00100000
01100111
01110101
01101001
01100100
01100001
01101110
01100011
01100101
00100000
01101110
01100101
01100101
01100100
01100101
01100100
00100000
00100000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
10110000
The formula I am attempting to use is:
=INDEX((Input,Length),SEQUENCE(ROWS(Input)+ROWS(Length)))
However the Length
range is generating a #REF!
error, which I cannot resolve:
01010011
01101111
01101101
01100101
00100000
01100111
01110101
01101001
01100100
01100001
01101110
01100011
01100101
00100000
01101110
01100101
01100101
01100100
01100101
01100100
00100000
00100000
#REF!
#REF!
#REF!
#REF!
#REF!
#REF!
#REF!
#REF!
I have attempted to use other functions which either failed to combine the arrays, and/or generated various other #NUM!
and #VALUE!
errors.
I have also swapped the order from Input
,Length
to Length
,Input
, which generates the same #REF!
error for the second array.
I suspect I have been looking at it too long and simply need fresh eyes.
I want to use native Excel functions and formulas instead of VBA or other programmatic approaches.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
单程:
=TEXT(FILTERXML(""&TEXTJOIN("",1,TRANSPOSE(IF NA(IF(SEQUENCE(,2,0),长度,输入),"")))&"","//b"),REPT(0,8) )
更严格的替代方案:
=LET(α,ROWS(输入),β,ROWS(长度),γ,MAX(α,β),δ,SEQUENCE(2*γ,,0),ε,INDEX(CHOOSE) (序列(,2),输入,长度),1+MOD(δ,γ),1+商(δ,γ)),FILTER(ε,1-ISNA(ε)))
One way:
=TEXT(FILTERXML("<a><b>"&TEXTJOIN("</b><b>",1,TRANSPOSE(IFNA(IF(SEQUENCE(,2,0),Length,Input),"")))&"</b></a>","//b"),REPT(0,8))
More rigorous alternative:
=LET(α,ROWS(Input),β,ROWS(Length),γ,MAX(α,β),δ,SEQUENCE(2*γ,,0),ε,INDEX(CHOOSE(SEQUENCE(,2),Input,Length),1+MOD(δ,γ),1+QUOTIENT(δ,γ)),FILTER(ε,1-ISNA(ε)))