这是我要做的事情的简化示例。
cat 2
dog 3
翻译为:
cat
cat
dog
dog
dog
仅使用单元格中的函数是否可行?还是必须使用宏之类的东西?我该怎么办?
答案 0 :(得分:2)
在Google表格中,假设狗和猫在A1和A2中,而2和3在B1和B2中,则可以这样做:
=transpose(split(rept(A1&" ",B1)&rept(A2&" ",B2)," "))
答案 1 :(得分:1)
在Google表格中,假设“狗2”和“猫3”位于A1和A2中,则可以这样做:
=transpose(QUERY({(split(rept(split(A1," ")&" ",query(split(A1," "), "SELECT Col2"))," ")),(split(rept(split(A2," ")&" ",query(split(A2," "), "SELECT Col2"))," "))},,))
信用:
G4mo在StackOverflow How to make a range repeat n-times in Google SpreadSheet
中答案 2 :(得分:1)