简体   繁体   中英

If a cell in a column contains a specific string, then add a different cell value to an additional cell

I am trying to have Apps Script perform the following:

  • If a cell in column H contains the string "Credit Card" then add that rows column C value (sum) to cell K6.

I believe I would put together a loop function for this, but I am a brand new beginner with JavaScript and coding in general.

As for Apps Script scripting, I see a onSelectionChange trigger that could initiate your script which would compare the stringified cell contents to "Credit Card".

Unrelated to Google Sheets, a webpage script would use Javascript with the DOM APIs, you would use keyUp events to trigger your script which would do a string comparison against the trimmed input String.prototype.trim() , and then perform whatever actions you want to after that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM