![](/img/trans.png)
[英]Google Sheets Apps Scripts how to populate specific text in the same row of the last non-empty cell in another specified column
[英]if row contains specific text then build average google apps scripts (google sheets) (Javascript)
我不知道如何在工作表中或在使用Google Apps腳本的腳本工具中的Google工作表中編寫代碼。
例:
January 2017|February 2017|March 2017|April 2017|...
----------
Numberscolumn |Numberscolumn|
----------
例如,我只想建立包含單詞“ January”或“ April”的列的平均值。 如何輸入正確的代碼?
例:
=IF(TRUE;SEARCH("January "&" =ISNUMBER"; A2:A20))
還是用Google Apps腳本編寫宏?
如果標題是文本而不是實際日期,那么這應該對您有用
=average(filter(transpose(A2:F),regexmatch(transpose(A1:F1),"January|April")))
=average(filter(transpose(A2:F),(transpose(A1:F1)=datevalue("January 2017"))+(transpose(A1:F1)=datevalue("April 2017"))))
或匹配月份而不指定年份
=AVERAGE(filter(transpose(A2:F),(text(transpose(A1:F1),"MMMM")="January")+(text(transpose(A1:F1),"MMMM")="April")))
或更簡潔
=AVERAGE(filter(transpose(A2:F),regexmatch(text(transpose(A1:F1),"MMMM"),"January|April")))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.