是否有Google表格功能可将范围缩小为一列? [英] Is there a Google Sheets function to squeeze a range into one column?

查看:89
本文介绍了是否有Google表格功能可将范围缩小为一列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为此找不到内置函数,所以我不得不用脚本编写它:

I wanted to find the built-in function for this to no avail so I had to write it in script:

function squeeze(range) {
  return [].concat(...range).filter(n => n)
}

此JS函数将2D数组range展平并返回.

This JS function flattens the 2D array range and returns it.

注意,它会过滤掉具有不均匀列的空单元格.

Note that it filters out empty cells with uneven columns.

推荐答案

虽然尚未正式记录,但flatten()也作为内置公式存在. 请参阅在此处获取更多信息.

While not officially documented (yet), flatten() also exists as a built-in formula. See here for more info.

这篇关于是否有Google表格功能可将范围缩小为一列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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