在Google表格中的一组数据中添加空白行 [英] Adding blank rows in a set of data in Google Sheets

查看:57
本文介绍了在Google表格中的一组数据中添加空白行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组数据.我期待的是在每个这样的3个值集之后添加2个空白行

I have a set of data. What i am looking forwards is to add 2 blank rows after each set of 3 values like this

希望获得帮助以解决此问题.

Hope to get help in getting this solved.

您可以在此处找到示例Google表格: https://docs.google.com/spreadsheets/d/11nMvUWn3xcTfxlk4v30KruPr03HSheMk1jrxZPpJ_p4/edit?usp=sharing

you can find the sample google sheet here : https://docs.google.com/spreadsheets/d/11nMvUWn3xcTfxlk4v30KruPr03HSheMk1jrxZPpJ_p4/edit?usp=sharing

谢谢

Shijilal

推荐答案

前一段时间,我创建了这个自定义函数,可以为您提供帮助.为了满足您的要求,我对其进行了少许更改,并将其添加到脚本编辑器中.

Some time ago, I created this custom function that may help you. I changed it slightly to meet your requirement and added it to the script editor.

function rowsBetween(range, s, rowsWithData, text) {
var n = [],
    a = [],
    i = 0;

while (i < s) {
    a.push(text
    )
    i++;
}
range.forEach(function(r, i) {

    n.push(r);
     if((i + 2) % rowsWithData == 1) {
    a.forEach(function(x) {
        n.push(x);
    });
    }
});
return n;
}

此脚本将允许您在电子表格中输入此(自定义)公式(另请参见单元格E2)

This script will allow you to enter in the spreadsheet this (custom) formula (see also cell E2)

=rowsBetween(A2:A16, 2, 12,)

看看这是否适合您?

这篇关于在Google表格中的一组数据中添加空白行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆