formulas

How to use native spreadsheet functions in google apps script?

半城伤御伤魂 提交于 2019-12-09 15:11:59
问题 Is it possible to use native spreadsheet functions such as sum() or today() in google apps script, when writing code for google Spreadsheet? If so, how do I do it? 回答1: Google Apps Script is JavaScript, spreadsheets functions are not available and using a workaround like setFormula followed by getValue is not only cumbersome but really slow and inefficient. You will be better inspired to use JavaScript and Google services to manipulate data taken from a spreadsheet and write the data back in

How do I get amazon price information into Google Sheets?

半腔热情 提交于 2019-12-08 10:15:50
问题 In the old version of Google spreadsheets, this could be done with the following formula: =value(importXml("http://www.amazon.com/<your url here>", "//b[@class='priceLarge']")) However, in the new version of Google spreadsheets, this does not work How is this to be done now? 回答1: This worked for me: =importxml(hyperlink(concatenate("AMAZON_URL_HERE")),"//*[@id='priceblock_ourprice']") 回答2: You have to replace the , by a ; to make it work: =importxml(hyperlink(concatenate("AMAZON_URL_HERE"));"

Array expand with one formula

末鹿安然 提交于 2019-12-08 04:24:03
问题 input: A 4 B 3 C 2 output: A A A A B B B C C Using only one formula. no code please. 回答1: =ArrayFormula(IFERROR(TRANSPOSE(SPLIT(CONCATENATE(REPT(A:A&CHAR(9);B:B));CHAR(9))))) 来源: https://stackoverflow.com/questions/17897310/array-expand-with-one-formula

Timezone conversion in a Google spreadsheet

寵の児 提交于 2019-12-05 09:20:22
问题 I know this looks simple. In a Google spreadsheet, I have a column where I enter time in one timezone (GMT) And another column should automatically get time in another time zone(Pacific Time) GMT | PT ----------|------------ 5:00 AM | 9:00 PM As of now I am using =$C$3-time(8,0,0) The problem here is, I want to change the time formula for Daylight savings. Is there any function or script available which can take the daylight saving into calculation automatically. 回答1: Short answer There is no

Change #N/A to Blank cell

随声附和 提交于 2019-12-05 06:37:09
How can I change the #N/A to the blank cell if nothing in that cell? Eg. =VLOOKUP(B19:B36;$TABLE.A1:C46;2;0) I think I might need something like an ISERROR check but I don't 100% know what I'm doing. Taosique If we're talking about Excel 2010 and later you can use IFERROR : =IFERROR(VLOOKUP(B19:B36;$TABLE.A1:C46;2;0);"") You can also put text into the final string result The question was misleading about the spreadsheet software as 2 different spreadsheets were originally stated in tags. However, it can be seen that the question is about OpenOffice Calc: - Absolute sheet referencing ( $ sign

How can I normalize / asciify Unicode characters in Google Sheets?

为君一笑 提交于 2019-12-04 12:07:40
问题 I'm trying to write a formula for Google Sheets which will convert Unicode characters with diacritics to their plain ASCII equivalents. I see that Google uses RE2 in its "REGEXREPLACE" function. And I see that RE2 offers Unicode character classes. I tried to write a formula (similar to this one): REGEXREPLACE("público","(\pL)\pM*","$1") But Sheets produces the following error: Function REGEXREPLACE parameter 2 value "\pL" is not a valid regular expression. I suppose I could write a formula

How to use a formula written as a string in another cell [evaluate for Google Spreadsheet]

时间秒杀一切 提交于 2019-12-04 04:58:55
I read several old posts about Google Spreadsheet missing the evaluate function. There is any solution in 2016? The easiest example. 'A1' contains the following string: UNIQUE(C1:C5) 'B1' I want to evaluate in it the unique formula written in 'A1'. I've tried concatenating in this way: 'B1' containing ="="&A1 but the outcome is the string =UNIQUE(C1:C5). I've also tried the indirect formula. Any suggestion to break last hopes, please? Additional note The aim is to write formulas in a spreadsheet and use these formulas by several other spreadsheets. Therefore, any change has to be done in one

Timezone conversion in a Google spreadsheet

青春壹個敷衍的年華 提交于 2019-12-03 22:16:40
I know this looks simple. In a Google spreadsheet, I have a column where I enter time in one timezone (GMT) And another column should automatically get time in another time zone(Pacific Time) GMT | PT ----------|------------ 5:00 AM | 9:00 PM As of now I am using =$C$3-time(8,0,0) The problem here is, I want to change the time formula for Daylight savings. Is there any function or script available which can take the daylight saving into calculation automatically. Short answer There is no built-in function but you could build a custom function. Example /** * Converts a datetime string to a

How can I normalize / asciify Unicode characters in Google Sheets?

拈花ヽ惹草 提交于 2019-12-03 07:32:27
I'm trying to write a formula for Google Sheets which will convert Unicode characters with diacritics to their plain ASCII equivalents. I see that Google uses RE2 in its "REGEXREPLACE" function. And I see that RE2 offers Unicode character classes . I tried to write a formula (similar to this one ): REGEXREPLACE("público","(\pL)\pM*","$1") But Sheets produces the following error: Function REGEXREPLACE parameter 2 value "\pL" is not a valid regular expression. I suppose I could write a formula consisting of a long set of nested SUBSTITUTE functions ( Like this one ), but that seems pretty awful.

Linking one google docs spreadsheet to another [closed]

穿精又带淫゛_ 提交于 2019-12-03 03:45:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have data in one google docs. Call it docA. I would like to reference this data in docB. Something along the lines of =docA!Sheet1!A2 How would I be able to go about this? I do not mind changing security settings and the like 回答1: First go to the spreadsheet that you want to import the data from (docA) and