Does Google Sheets have "Volatile" Functions like Excel? - google-sheets

In Excel, Vlookup and Indirect are notorious examples of Volatile Functions in which there is an unnecessary amount of recalculations every-time you edit a cell (even if it does not change the output). Is there a list of volatile functions in Google Sheets and is there any documentation warning about its use or is this not the same type of problem?
Update: Vlookup is not officially volatile in the latest version of excel but it did used to cause (haven't checked recently) recalculations when editing cells that could never change the output due to poor optimization.

Part of this question asked if there is any documentation listing which sheets formulas are volatile. I couldn't find any list from Google. (There are lots of 3rd party sites such as Ben Collins which provide a list, but no source is given). The only Google Documentation I could locate to confirm functions' volatility was to review the full list of Google Sheet's formulas. Unfortunately to fully check a formula, one has to click within the detail of each individual formula and check in the notes:
I cross-checked the Excel formulas that Microsoft lists as volatile and it appears Player() list is correct (no surprise). What's interesting (to me) is that Offset and Indirect are NOT listed as volatile in google sheets. This can allow for some more flexibility with array functions and other references.
Side Note on OP Comments Regarding Vlookup
OP asserts that vlookup is a volatile function. This is not correct, as was shown in the Microsoft link. VLookup does calculate less efficiently compared to index/match and xLookup but a change in a cell outside of the vlookup range will not trigger a recalculation.

yes, Google Sheet does have volatile functions:
NOW
TODAY
RAND
RANDBETWEEN
RANDARRAY
COINFLIP
WHATTHEFOXSAY
and the only issue with them is that they are hard to be frozen
update
with the latest pack of new functions, all volatile functions can be frozen:
=LAMBDA(x,x)(RAND())
=LAMBDA(x,x)(NOW())

Related

Order of Operations in Google Sheets

Has the order of operations changed in Google sheets?
If I enter in a cell
=1-1-1^2
I obtain -1
But if I enter
=-1^2
I obtain 1
If remember correctly, when I started using Google Sheets a few years ago, both expressions gave the same result -1. I was pleased that Google sheets had not adopted the irritating and deprecated Excel feature of giving the minus sign priority in the order of operations if it appeared by itself. But now I see that Google Sheets adopted the same rule as Excel. If I'm right, and Google somewhere down the road has decided to convert to the deprecated Excel habit, when was the order of operations altered?
logic of:
=1-1-1^2
is:
=1-1-(1^2)
if you expect the result to be 1 then you should write it as:
=1-1+(-1^2)
raising on the power is the top priority (as it should) over the minus sign (unless you use parenthesis) which are able to overwrite this priority and treat the minus as part of 1
pretty much the same as the windows calculator:
or google:
Has the order of operations changed in Google sheets?
no, it hasn't
when was the order of operations altered?
it wasn't. if you by any chance experienced different behavior then it was only fixed to reflect the current propper state

Google Sheets: API To Get Crypto Prices and History?

As GOOGLEFINANCE() seems very limited in the cryptocurrencies it supports, are there any (free?) APIs that I can use to get data from?
Although I use GF() for ETH and BTC, I'm specifically looking for Price and Historical Closing Prices on ADA (Cardano).
I've searched the forum for suggestions, there aren't many and most are old. Binance's API seemed OK, but it gives prices in USDT instead of USD.
If anyone is interested, I found an API that offers a free key, although limited in the number of daily calls you can make: CoinAPI.
It seems very powerful, with quotes available in most currencies. So far, I've managed to get a current price:
Formulas shown in brown.
(1) shows the raw data returned, a two rows delimited by semi-colons.
(2) wraps a QUERY() around IMPORTDATA(), using offset 1 plus param 0, to not return the header row, then wraps all that in SPLIT() to separate the delimited text into columns.
(3) wraps (2) with INDEX() so I can get just the Price in the 4th col.
As this value will not automatically update like GOOGLEFINANCE(), I think I'll need to set a Trigger to do that.
I've also retrieved historical data, but I've yet to figure out how to split multiple rows of delimited text from the IMPORTDATA() function.
[Edit] See the solution to splitting multiple rows by #player0 at https://stackoverflow.com/a/69055990/190925.

Cascading SUM INDEX INDIRECT MATCH MATCH function in Google Sheets (sample workbook included)

I'm attempting to write a function in google sheets that sums an INDEX INDIRECT MATCH MATCH value across multiple sheets - essentially the total number of hours each employee has allocated towards each client.
I took a first stab at it in cell D2 but I feel like there's gotta be a much more elegant way of writing it rather than copying the current function, adding a "+", then adjusting the tab name reference - especially bc the sheet list is growing by the week so it would be especially nice to auto-update as current weeks are added.
Please see the sample sheet here: https://docs.google.com/spreadsheets/d/1qEAJ1UcNQPD-doUaD3kfZgpDz2phpcXHUJWpVE01I10/edit?usp=sharing
(all sensitive names and clients have been replaced with dummy data)
Thanks so much for your help!
=IF(IFERROR(INDEX(INDIRECT("'"&$B2&"'!"&$A$3),MATCH('client allocation'!E$1,INDIRECT("'"&$B2&"'!"&$A$4),0)),"")=0,"",IFERROR(INDEX(INDIRECT("'"&$B2&"'!"&$A$3),MATCH('client allocation'!E$1,INDIRECT("'"&$B2&"'!"&$A$4),0)),""))
#Excel 2007-365
D2 →
=SUM(INDIRECT("'"&dates_all&"'!R"&RIGHT($A$3,2)&"C[-1]",))
This is for your reference only.

Find sector by share symbol in google sheets

Is there a way to print out the GICS sector name for a specific share/ETF symbol in google sheets using the GOOGLEFINANCE commands or any other way?
Many thanks
I used this site to find several scraping methods to get data from finviz.
https://decodingmarkets.com/scrape-stock-data-from-finviz/
Extending their logic, I was able to get the company name, and the combined sector/subsector codes
(I originally used the website's scraping techniques to get Dividend data that GoogleFinance formula lacks...)
This formula gets the company name using US ticker symbol in cell C3:
=SUBSTITUTE(INDEX(IMPORTHTML("http://finviz.com/quote.ashx?t="&C3,"table",6),2,1),"*","")
Through trial and error, I found that table 6 has name and sectors. I then referenced the 2nd row and 1st column to get the name.
I found that row 3, column 1 has the sector, subsector and country combined as one value. They use a pipe | delimiter for each break.
Using the split function, I was able to split segment.
=SPLIT(SUBSTITUTE(INDEX(IMPORTHTML("http://finviz.com/quote.ashx?t="&C3,"table",6),3,1),"*",""),"|",true,true)
Its not available from Sheets
Check out the official docs:
https://support.google.com/docs/answer/3093281?hl=en
It has a lot of options but unfortunately, not that one.
If you think it would be useful, then make sure you file a feature request #
https://developers.google.com/issue-tracker
As for any other way
#GSee said it best here: https://stackoverflow.com/a/16525782/10445017

Editable vlookup value returned?

I have two pages of spreadsheets in Google Sheets. Sheet1 and Sheet2.
I have a Vlookup function in Sheet2 that returning me the value in sheet1.
I would like to know if there is a way to edit this returned value in sheet2 and this value entered in sheet2 be updated in sheet1.
If I try to do that now, it only changes the vlookup formula.
No, this is simply not possible.
Data can be displayed in many places, or used in many formulas, but if it is "just" a value in a cell, it must have one canonical source.
If this is a serious requirement for your project, consider using a database rather than a spreadsheet. Or research whether or not this sort of dual-direction flow is feasible and advisable via Google Apps Script. Both of those are serious undertakings though, and almost certainly overkill.

Resources