如何返回内置的 Google 电子表格函数可以使用的字符串 [英] How do I return a string that the built in Google Spreadsheet function can us
本文介绍了如何返回内置的 Google 电子表格函数可以使用的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个函数返回一个字符串,该字符串是我需要使用 UNIQUE() 内置函数扫描的单元格,但它不处理返回的值.
I have a function that returns a string that are the cells that I need to scan with the UNIQUE() built-in function, but it does not process the returned value.
尝试将它们放在引号中,但没有帮助.
Tried putting them in quotes, didn't help.
function GetRange(sheet, ColumnLetter , Offset)
{
var startColumn = letterToColumn(ColumnLetter);
var string = "";
for(var i=startColumn; i <= Offset; i++)
{
string += sheet + "!" + columnToLetter(i) +":"+columnToLetter(i)+";";
}
string = string.substring(0, string.length-1);
return string+"";
}
在工作表方面,我在一个单元格中有这个
On the Sheet side I have this in a cell
=UNIQUE({GetRange("Raid","C", 30)})
我希望将返回的字符串放入内置的 UNIQUE()
函数中,并像手动输入一样执行代码.
I expected to get the returned string into the built-in UNIQUE()
function, and execute the code like I would if I would have typed it in manually.
相反,它只是像这样将返回的字符串输出到单元格中
Instead, it just outputs the returned string into the cell like this
Raid!C:C;Raid!D:D;Raid!E:E;Raid!F:F;Raid!G:G;Raid!H:H;Raid!I:I;Raid!J:J;Raid!K:K;Raid!L:L;Raid!M:M;Raid!N:N;Raid!O:O;Raid!P:P;Raid!Q:Q;Raid!R:R;Raid!S:S;Raid!T:T;Raid!U:U;Raid!V:V;Raid!W:W;Raid!X:X;Raid!Y:Y;Raid!Z:Z;Raid!AA:AA;Raid!AB:AB;Raid!AC:AC;Raid!AD:AD
推荐答案
试试这样:
=ARRAYFORMULA(SORT(UNIQUE(TRANSPOSE(SPLIT(TRIM(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
IF(LEN(Raid!A1:A), IF(Raid!C1:AL<>"", "♦"&Raid!C1:AL, ), )),,999^99)),,999^99)), "♦")))))
这篇关于如何返回内置的 Google 电子表格函数可以使用的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文