【发布时间】:2021-10-04 19:49:19
【问题描述】:
所以我从 GMail 中提取了一些数据,并在具有特定格式的工作表中添加了一个新行。姓名、地址等
在“P”列我想复制以下内容:
=IF(NOT(ISBLANK($J3985)),"Replied", IF((TODAY()>=$O3985),"Late", "OK"))
但是,我想用 Row() 替换 3985,作为我正在附加的行号,同时我正在附加它。我试过玩:ADDRESS(row(),10) 但这会返回一个字符串值,我似乎无法以一种有效的方式重新插入到公式中。
我现在在 appendRow 中经过的内容:
var replied = "";
var later = x // a Date that's today + 6 weeks
var checkResult = `=IF(NOT(ISBLANK(` + replied + `)), "Replied", IF((TODAY()>=` + later + `), "Late", "OK"))`;
我想要它,以便我可以稍后在工作表中填充“已响应”单元格并使其仍然有效。很想听听您的建议。
【问题讨论】:
-
我必须为我糟糕的英语水平道歉。不幸的是,我无法理解你的问题。您能否提供您期望作为图像的示例输入和输出情况?对了,
I want it so that I can populate the "responded" cell at a later point in the sheet and for this to still work.是什么? -
您是否尝试过使用
sheet.getLastRow() + 1?=IF(NOT(ISBLANK(`J${sheet.getLastRow() + 1}`)), "Replied", IF((TODAY()>=`${later}`), "Late", "OK")) -
假设
sheet被定义为SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Name of Sheet to Append data') -
这会检查现在的情况,但对我来说不够动态,因为我想稍后填充该 J 值并让公式仍然有效。
标签: google-apps-script google-sheets gmail