Google表格通过分割逗号分隔的多个值来复制行
我在 Google 表格中有数据,其中单列中提到了多个日期。我想分隔每个日期,并且每个日期应重复同一行。
我将不胜感激你的帮助。
尝试这样做,但它不起作用。
=ARRAYFORMULA({"DATE","EMPLOYEE NAME";QUERY(IFERROR(SPLIT(FLATTEN(IFERROR(Sheet1!A:D
&CHAR(9999)&SPLIT(Sheet1!H:H,","),)),CHAR(9999)),),
"SELECT Col2, Col1 WHERE Col2 IS NOT NULL ORDER BY Col2 ASC",0)})
我尝试过此操作,但它没有拆分日期。
function result(range) {
delimiter = ","
targetColumn = 8
var output2 = [];
for(var i=0, iLen=range.length; i<iLen; i++) {
var s = range[i][targetColumn].split(delimiter);
for(var j=0, jLen=s.length; j<jLen; j++) {
var output1 = [];
for(var k=0, kLen=range[0].length; k<kLen; k++) {
if(k == targetColumn) {
output1.push(s[j]);
} else {
output1.push(range[i][k]);
}
}
output2.push(output1);
}
}
return output2;
}
I have Data in Google Sheets Where multiple Dates are mentioned in single column. I want to separate the Each date and same row should be repeated for each date.
I would appreciate your help.
Trying with this but its not working.
=ARRAYFORMULA({"DATE","EMPLOYEE NAME";QUERY(IFERROR(SPLIT(FLATTEN(IFERROR(Sheet1!A:D
&CHAR(9999)&SPLIT(Sheet1!H:H,","),)),CHAR(9999)),),
"SELECT Col2, Col1 WHERE Col2 IS NOT NULL ORDER BY Col2 ASC",0)})
I tried with this but its not spliting the dates.
function result(range) {
delimiter = ","
targetColumn = 8
var output2 = [];
for(var i=0, iLen=range.length; i<iLen; i++) {
var s = range[i][targetColumn].split(delimiter);
for(var j=0, jLen=s.length; j<jLen; j++) {
var output1 = [];
for(var k=0, kLen=range[0].length; k<kLen; k++) {
if(k == targetColumn) {
output1.push(s[j]);
} else {
output1.push(range[i][k]);
}
}
output2.push(output1);
}
}
return output2;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
continue
try:
update:
or: