How to work around GOOGLEFINANCE failures? - google-sheets

I need historical data of currency exchange rates for my gooogle sheet and GOOGLEFINANCE function is just what i need. Here is the sheet with GOOGLEFINANCE data I copied from my project:
https://docs.google.com/spreadsheets/d/15cFmrS2IL6QZMJORCJxU16QtWQ-2hFNLORgM5pEgY_E/edit?usp=sharing
The problem is that sometimes (pretty often actually) GOOGLEFINANCE function crashes and returns error breaking the whole project:
that's how it looks when it crashes
It returns to normal after a while but it's really disturbing.
I couldn't think of a good way to work around that glitch so I'm asking for your help.
I thought about making cells with the following logic: IF GOOGLEFINANCE value is not blank then copy it ELSE keep old value making GOOGLEFINANCE return persistent but I'm not sure it's possible to do with Google Spreadsheets formulas.
For example above if we want to make L4 cell to contain persistent value of C4 cell, I want L4 formula to be like:
=IF(ISBLANK(C4),L4,C4) but then cell will refer to itself which is not allowed.

This is not possible without Apps Script
This is because sheet functions aka formulae, don't write values to cells. If you need to persist data, then you need Apps Script.
Unfortunately, GOOGLEFINANCE cannot be accessed outside of Spreadsheet formula. From https://workspaceupdates.googleblog.com/2016/09/historical-googlefinance-data-no-longer.html
it (is) not be possible to download historical data or access it outside of Sheets using Apps Script or an API.
Workaround (with Apps Script)
However, it is possible to set up an Apps Script function to read the displayed value of a cell with getDisplayValue(), and copy that to a backup sheet, where you somehow store historical data.
You could have a setup where you have one sheet with the GOOGLEFINANCE formula, another sheet with the backup values, and a final "Report" sheet. Then you could write another Apps Script function to examine both the sheets and build an output.
Further, you could set this up to run with Time-driven triggers, and it would be quite hands off.
References and further reading
getDisplayValue()
Time-driven triggers
Apps Script Tutorials

Related

With zapier & Google Sheets: How do I trigger a new line in the entire spreadsheet?

I'm a bit puzzled. I can't set Zapier to trigger when a new line is added to any sheet on a Google spreadsheet. They force you to choose a specific sheet. Any way around it?
Cheers!
You will need to create a different "Zap" event for each sheet. To my knowledge, there is no way around that.
However, the fact that you think Zapier should be able to have a single Zap be triggered by multiple sheets implies a couple or things:
1.) You're not yet sure what a "Zap" is.
2.) Your data in each separate sheet is very similar. And this causes me to wonder if your overall spreadsheet setup is less than ideal. Many people wind up setting up separate sheets for data collection, whereas in most cases, data collection should only be done in one sheet setup as a standard database, while other sheets show the data in different arrangements (i.e., reports).
You haven't given much detail or provided a link to the spreadsheet. But perhaps this will prompt you to dive into understanding Zapier a bit better and reconsidering the layout of your spreadsheet(s).

Legacy Values Left In Google Sheets

I'm currently using a Google spreadsheet that has many filter functions and many sheets, when one value is changed on one sheet the filter function on the other sheets is changed due to the condition changing and a recalculation occurs.
The bug seems to be that sometimes data from the previous filter function is left in the cells and is not cleared automatically. I have made a quick script that clears cells that have the potential to hold old data, which works but shouldn't be the case.
Has anyone else ever had this issue?
Thanks and I hope this has been explained well enough.

Google Sheets 50 million cell count work around

Is there a way to get around the 50 million cell count rule? Can this be done by using 2 separate workbooks?
We have a lead tracking system that we have built in a Google Sheets workbook and with the way our leads get updated we have already hit the 50mil record count in Google Sheets over the past 3 months. Deleting the data is not an option as we have to analyze weekly monthly quarterly and yearly stats.
I am pretty sure IMPORTRANGE would still hit the 50mil cell count limit.
Is there a way around this limit?
Update:
So a way to combat the cell limit is to totally delete all columns and rows that you do not use and are empty. Trimming the sheets down to just what you have filled in rows and columns.
Apparently if the cell has no data in it it still counts against your cell count despite it being empty.
This is not a solution per say but it is a way to make sure empty cells are not counting against your cell count.
Answer:
There is no way around this. According to the Google File Size documentation[1], the limits on a Spreadsheet are:
​Up to 5 million cells or 18,278 columns (column ZZZ) for spreadsheets that are created in or converted to Google Sheets.
Things I Tested:
Starting in 2019 it became possible to edit Office files natively in G Suite[2] so I thought I'd give it a test. According to the specifications and limits page for Microsoft Office Excel[3]:
Total number of rows and columns on a worksheet: 1,048,576 rows by 16,384 columns
Which totals 17,179,869,184 cells.
As Spreadsheets that are created on Google Drive have the Google Drive limit, I created an Excel workbook on my local machine, with the maximum number of possible cells and uploaded it to Drive to see if it could be edited natively. Unfortunately, while the file uploaded successfully, attempting to open the file resulted in the following page:
More Information, Workarounds & Similar Services:
Honestly if you need more than 5 million cells in a Spreadsheet (or even 50 million!) then you're not using the right tool for the job. With this much data, you're likely better off using a database or a cloud data warehouse such as Google BigQuery[4] or Cloud SQL[5]
That being said, if Google Sheets/Spreadsheet workbooks really is the only way forward for you, the only thing I can recommend you doing is creating multiple Sheets files, separated into a more appropriate timeframe - each Sheet containing data for just a month. This will take a bit more time to set up (though you can use Apps Script for data migration between the Sheets), but in the long run will mean you will be able to use your data more effectively, and any data processing you need to do will complete within the Apps Script Quotas[6].
References:
Google Drive Help - Files you can store in Google Drive
G Suite Updates - "Office editing makes it easier to work with Office files in Docs, Sheets and Slides."
Excel specifications and limits
Google BigQuery
Google Cloud SQL
Google Apps Script - Quotas for Google Services

Hide formulas from non editors

The goal is to hide the formulas in the cells in order to show only the data to the users in the very same spreadsheet.
Why? Currently I'm showing some information to the teams, but the formulas contain info that these teams shouldn't be able to know.
To minimize the problem I'm importing most of the data using formulas such IMPORTRANGE or QUERY but even those methods show the URL of the original spreadsheet.
Use a Script to copy isn't a viable solution due the amount of data and frequency some those sheets receive updates.

Disable automatic calculation for Google Spreadsheet

is it possible to specify to Google spreadsheet not to recalculate a specific sheet or number of cell everytime a modification is done ?
I have a very heavy sheet and it's very slow everytime i made a tiny modification, even if it's in an another sheet.
Seems that this feature is not supported by Google Spreadsheets. From a cursory search online the easiest way to work around this limitation is to make your formulas all conditional on a trigger. ie =IF(Boolean_Trigger,Your_formula,""). Trigger could be a cell, Named range, etc. Regards,

Resources