//Имя столбца по его номеру
function col2A1(col){
let result = "";
let base = 27;
while(col>0){
let newLetter = String.fromCharCode("A".charCodeAt(0)+(col-1)%(base-1));
result=newLetter + result;
col = (col - col%base) / base;
};
return result;
};
// или короткая версия
function col2A1_(r){let o="";for(;0<r;){var t=String.fromCharCode("A".charCodeAt(0)+(r-1)%26);o=t+o,r=(r-r%27)/27}return o}
29\.0?2\.(1904|1908|1912|1916|1920|1924|1928|1932|1936|1940|1944|1948|1952|1956|1960|1964|1968|1972|1976|1980|1984|1988|1992|1996|2000|2004|2008|2012|2016|2020|2024|2028|2032|2036|2040|2044|2048|2052|2056|2060|2064|2068|2072|2076|2080|2084|2088|2092|2096)
=FILTER(ДАННЫЕ;УСЛОВИЕ_ФИЛЬТРАЦИИ)
=ИНДЕКС(ДАННЫЕп1;ОКРУГЛВВЕРХ(СЛЧИС()*ЧСТРОК(ДАННЫЕп1)))
function filterByColor(dataRangeName, colorRangeName) {
let ss = SpreadsheetApp.getActiveSpreadsheet();
let colorRange = ss.getRangeByName(colorRangeName);
let color = colorRange.getBackground();
let dataRange = ss.getRangeByName(dataRangeName);
let data = dataRange.getValues();
let colors = dataRange.getBackgrounds();
return data.map((row,ri)=>row.map((val,ci)=>color===colors[ri][ci]?val:""));
}
Worksheets("Sheet1").Range("A" & i) = Replace(xcell, " ", x)
xcell = Replace(xcell, ".", x)
xcell = Replace(xcell, ",", x)
xcell = Replace(xcell, "(", x)
xcell = Replace(xcell, ")", x)
xcell = Replace(xcell, " ", x)
Worksheets("Sheet1").Range("A" & i) = xcell
=еслиошибка(
importrange("ссылка";прописн(диапазон))
;importrange("ссылка";строчн(диапазон))
)
/**
* Возвращает массив данных импортированных с таблицы url, с листа sheetName со столбцов columsn
*
* @param {String} url Ссылка на таблицу
* @param {String} sheetName Имя листа
* @param {Array[Number]} columsn Массив номеров столбцов. A = 1
* @return Возвращает массив импортированных данных
*/
function importColumns(url, sheetName, columsn) {
columsn = [...columsn].flat(Infinity).map(column=>-1+column);
let sourceSpreadsheet = SpreadsheetApp.openByUrl(url);
let sourceSheet = sourceSpreadsheet.getSheetByName(sheetName);
let data = sourceSheet.getDataRange().getValues();
outData = data.map(row=>{
return columsn.map(column=>row[column]);
});
return outData;
}
let value = range.getCell(1, 1).getValue()
data.filter(row=>row[0]===value)
range.setValues(outData)