Google Sheets share only one row

(Updated Jan 2022 to reflect the increase in the cell limit of Google Sheets to 10 million.)

Slow Google Sheets?

Weve all been there, stuck watching the little loading bar creep slowly, frustratingly to its conclusion:

Google Sheets share only one row

How can you speed up a slow Google Sheet?

First off, this is a difficult question to answer because there are so many factors that may or may not be causing you to have a slow Google Sheet.

What follows in this article is some suggested optimization strategies and some research into what causes slow Google Sheets.


Strategies to speed up Google Sheets

  1. How to recognize slow Google Sheets
  2. Know the size limits of Google Sheets
  3. Measure a Google Sheets size
  4. Measure a Google Sheets calculation speed
  5. Delete un-used cells
  6. Convert formulas to static values wherever possible
  7. Use closed range references
  8. Remove volatile functions or use with caution
  9. Vlookup strategies
  10. Index-Match strategies
  11. Query function strategies
  12. Array Formula strategies
  13. Import Formula strategies
  14. Google Finance function strategies
  15. Use IF statements to manage formula calls
  16. Manage expensive formulas with a control switch
  17. Use Filter, Unique and Array_Constrain functions to create smaller helper tables
  18. Avoid long calculation chains
  19. Reference data on the same Sheet
  20. Use helper columns
  21. Split your slow Google Sheet into separate Sheets
  22. Use Conditional Formatting sparingly
  23. Leverage the power of Apps Script
  24. Use custom formulas sparingly
  25. Other troubleshooting tips for slow Google Sheets
  26. Understand changes in the cloud can take time to propagate
  27. Know when its time to move to a database

I remember the old days when you would set hundreds of thousands of VLOOKUP formulas loose on your dataset and then go out for lunch. If you were lucky theyd be finished when you returned. (And woe betide anyone who made a mistake with a formula!)

Although weve come a long way from those days, if you work with data a lot, chances are youll find yourself coming up against slow spreadsheets at some stage.

A lot of the tips that follow are generally good spreadsheet practices anyway, so even if you only work with small Sheets at the moment, theyre worth implementing now.

^ Back to top


1. How to recognize slow Google Sheets

If youre reading this, chances are youll recognize some or all of the following issues.

Calculations in your Google Sheets are super slow and the dreaded loading bar makes an appearance every time you make a change to your Sheet.

Google Sheets share only one row

Your Google Sheet becomes sluggish to respond to mouse clicks or keystrokes.

Data does not show in cell, even though you know youve entered data into the cell. For example, have a look at this formula that simply didnt show a value after being entered:

Google Sheets share only one row

Your Google Sheet becomes unresponsive. This is the worse case scenario, and in my experience, if this doesnt resolve fairly quickly, you dont often recover from here.

So if you see this error message, and youve waited a few minutes but nothings happening, then you might want to just bite the bullet, exit the page, and pickup again but trying a different approach this time.

Google Sheets share only one row

This is usually accompanied by your computer going into overdrive with the fan whirring loudly!

^ Back to top


2. Know the size limits of slow Google Sheets

Obviously if youre dealing with large Google Sheets Google Sheets with large amounts of data and/or formulas then youre more likely to see your performance suffer.

No discussion of slow Google Sheets therefore, would be complete without first discussing the size limits of Google Sheets.

Overall limit:

Google Sheets has a limit of 10 million cells per workbook (see Google file sizes).

If you do something that will take you past this limit (e.g. adding new rows or a new Sheet), youll see this error message:

Google Sheets share only one row

Column limit:

Google Sheets has a maximum number of columns of 18,278 columns.

If you do something that would take you past this limit, youll see the following error message:

Google Sheets share only one row

Individual cell-size limit

Within a single cell, theres a maximum string length of 50,000 characters (enough for approximately 500 average sentences, or about 162 Tolstoy sentences).

If you do something that would take you past this limit, youll see the following error message:

Google Sheets share only one row

^ Back to top


3. Measure a Google Sheets size

Using Apps Script, you can quickly build a simple tool to calculate the size of your Sheet.

This Sheets audit tool shows the total number of cells in the Sheet, how many have data in them and then statistics for each individual sheet too, including how many volatile and array functions you have (CLICK TO ENLARGE):

Google Sheets share only one row

Bonus: Get your own copy of this Google Sheet Audit Tool to measure the size of your Google Sheets.

The code for this tool can also be found here on GitHub if you prefer.

Ill do a post in the future looking specifically at how I built this tool with Apps Script.

New to Apps Script? Check out my beginner guide to Apps Script.

So thats measuring the size of Google Sheets, what about measuring their speed?

^ Back to top


4. Measure a Google Sheets calculation speed

To measure the speed of various calculations you can make use of Chromes Developer Tools.

In your browser window, you can access the Developer Toolkit by pressing Cmd + Option + I on a Mac or Ctrl + Shift + I (on a PC). It can also be accessed in the View > Developer menu.

Under the Performance tab of the Developer Tools you can record the webpage (or Google Sheet in this case) as it loads, and check the screenshots box to show you what is happening and when.

For formula calculations, you can identify when the calculations start, e.g. marked by the 1 in this image, at around the 3.6 seconds mark:

Google Sheets share only one row

The number 2 shows a screenshot at this point in time, so you can see that your formulas are not showing yet.

You can identify when the formulas have finished calculating (the red box, around the 8.6 seconds mark):

Google Sheets share only one row

Check the screenshot to see that the formula results are showing in the cells now.

And so you an see how long this batch of formulas took to calculate:

8.6s 3.6s = 5s

Google Sheets share only one row

Theres a whole lot more to the Developer Tools, but thatll do us for today.

This is the methodology Ive used to calculate formula speeds for comparison tests. I ran all of the tests in the same place at the same time of day (so wifi speed discrepancies were negligible) and also ran them each multiple times and took averages.

^ Back to top


5. Delete un-used cells

Your Google Sheets will get slower as they get larger.

So one of the first things to try, before getting into the marginal gains of formula optimization, is reduce the size of your Google Sheet.

Blank cells slow down performance, dramatically so in fact. So its a good idea to delete them whenever you can, so you reduce the number of cells Google Sheets is holding in memory.

Ideally you should remove any large numbers of blank rows under your datasets, or columns to the right of your datasets.

What about new rows being added automatically?

Dont worry if your data is being imported automatically by Apps Script or a third party tool like Supermetrics or Tiller, as the new rows are automatically added to your Sheet as required.

(However, you should always test this theory with your specific setup or app, to confirm this is the case.)

^ Back to top


6. Convert formulas to static values wherever possible

Once youve used a set of formulas in your data, and youre sure you wont need them again, you should convert them to values.

This should reduce the file size, which will help performance overall, and its also best practice (to reduce errors occurring if someone or something happens to break the formulas).

You change formulas to values by copying them and then:

Edit > Paste special > Paste values

Better yet, learn the keyboard shortcut to save yourself time. Highlight the formulas to change, Ctrl + C on a PC or Cmd + C on a Mac to copy and then Ctrl + Shift + V on a PC or Cmd + Shift + V on a Mac to paste as values.

Note, I advocate keeping a copy of a live formula at the top of your columns of data in your tables, so you have a record of how the calculation was performed and can also very quickly re-use it if needed:

Google Sheets share only one row

^ Back to top


7. Use closed range references

Closed range references means using something like A1:B1000 instead of A:B in your formulas (i.e. you explicitly specify the boundaries of your range).

If youre working with large Sheets and are using open references where you dont need to, this will be adding extra calculation overhead to your Sheet.

It might not look like theres much data in column A, but Sheets will check every cell, including all the blank ones, if you use open ranges like A:B.

Note: Whilst this is generally a good idea for speeding up your formulas, there are obviously situations when an open reference is desirable, for example when new data is anticipated. Leaving an open range will allow any new data to be included in calculations.

^ Back to top


8. Remove volatile functions or use with caution

In Google Sheets there are four functions, NOW(), TODAY(), RAND() and RANDBETWEEN(), that are known as volatile functions, which means they recalculate every time theres a change to the Sheet. All dependent formulas must also be recalculated too (i.e. formulas that reference or include a nested volatile function).

This uses up processing power and so can negatively impact your Sheets performance, although this is only going to be noticeable if you have large numbers of them.

To illustrate, I copied 100,000 TODAY() functions down column A, which took my machine about 5.5 seconds.

I then deleted 99,999 of these formulas and just left TODAY() in cell A1 and then put the following formula in cell A2:

= $A$1

and then copied this one down. The dollar signs represent absolute references and keep all my formulas locked onto cell A1.

Running this formula down 100,000 cells in column A took around 4.1 seconds, so almost 1.5 seconds quicker.

Its also best practice to do this, because if I ever need to make a change to the date, then I can just change it in this one place, A1, and not have to redo all of my formulas.

^ Back to top


9. Vlookup strategies

To improve the performance of your VLOOKUP formulas in Google Sheets, use closed, rather than open, range references for your search tables where possible (see no. 7 above).

Reduce the size of your lookup table, if possible, although this only has a marginal positive effect in my experience. For example, rather than search across everything you might use the Filter function to create a smaller, helper table for the lookup first, and then use that in your VLOOKUP (see no. 17 below).

However, dont be tempted to nest other functions inside your VLOOKUP and create the table on the fly each time. Its much, much slower.

For example, this formula is bad practice and will really slow down your Sheet if you have a lot of them:

=VLOOKUP( $A1 , UNIQUE( FILTER( $K$1:$N$10000 , $K$1:$K$10000 < 100 )) , 2 , FALSE )

whereas creating that nested Filter table as a helper table and referencing it is the preferred method:

=VLOOKUP( $A1 , $F$1:$I$10 , 2 , FALSE)

Combining VLOOKUPs with Array Formulas to return multiple column values with a single lookup is significantly slower than simply using multiple individual VLOOKUPs.

In Excel, sorting your data and using approximate matching (TRUE as your final argument in the VLOOKUP) is quite a bit faster than the exact matching algorithm (FALSE as the final argument). Its slightly quicker in Google Sheets too, but only slightly it seems, so its not worth the extra hassle.

Another Excel VLOOKUP trick is to use two approximate matching VLOOKUPs instead of a single exact match. Its significantly faster because the underlying search algorithm is much, much faster. However, I found this technique was actually slightly slower on Google Sheets so I wouldnt recommend it.

^ Back to top


10. Index-Match strategies

The Index-Match is a powerful lookup combination and well worth learning (learn it in day 10 of my free Advanced Formulas 30 Day Challenge course).

In its classic construction, you might see formulas like this:

=INDEX( Sheet2!$A$2:$P$51 , MATCH($A3,Sheet2!$G$2:$G$51,0) , MATCH(C$1,Sheet2!$A$1:$P$1,0) )

where you have two nested MATCH functions to lookup the row and column numbers (which is why index-match-match is so flexible).

This is fine for small numbers of index-match-match formulas, but inefficient at scale.

Say youre looking up 10,000 rows and 10 columns. For every single cell, youre using two matches to lookup the row number and the column number, so your total number of calculations would be:

No. of Match functions for row +
No. of Match functions for column +
Index Match function =

(10,000 rows * 10 matches) +
(10,000 rows * 10 matches) +
(10,000 rows * 10 indexes) =

300,000 calculations

Much better to split the match lookups out into their own helper row and column rows, as shown in this example:

Google Sheets share only one row

By splitting both the match lookups into their own row and column, you can compute them all once first, and then use those numbers in your index function.

Now youll only have to calculate the index function when you do your calculation, so your total calculations now would be:

(10,000 matches for the rows) +
(10 matches for the columns) +
(10,000 * 10 indexes) =

110,010 calculations

Significantly less than before, only about 1/3 as many calculations to do!

^ Back to top


11. Query function strategies for slow Google Sheets

As alluded to above , using open range references can hurt performance because you may inadvertently include thousands of extra blank rows in your calculations (see no. 7 above).

Instead, use closed range references or create smaller helper tables as inputs to your Query functions to speed up performance.

For example, running tests with a QUERY function, I found that each additional 20,000 empty rows I was including with open ranges would add 1 second to the calculations.

So rather than a formula like this for example:

=QUERY( Sheet2!A:E , "select *" , 1 )

youd be better served by specifying the range explicitly:

=QUERY( Sheet2!A1:E100000 , "select *" , 1 )

This improves the Query function speed because the calculation is no longer including all of the blank rows in Sheet 2 under the dataset.

^ Back to top


12. Array Formula strategies

If you spend long enough reading help forums youll find people saying that using a single array formula to replace hundreds of individual formulas will be quicker, and others staunchly saying the opposite. So which is it?

In my experience, array formulas working on big datasets (those with lots of rows) are slow and will make your Sheet sluggish. Ive found they tend to be slower than the individual formulas.

However, theyre so useful in specific situations, like gathering Google Form data, that I still recommend learning about them and using them, with caution.

I use them heavily for performing running calculations on datasets that grow over time (new rows being added). That way I know the calculation happens without me needing to update anything.

For example, this formula:

=ArrayFormula( IF( A2:A <> "" , A2:A * 100 , "" ))

which is the array version of this individual formula:

= IF( A2 <> "" , A2 * 100 , "" )

will automatically compute a value for every new row of data added.

I would test both versions on your own sheets, and choose whichever is most appropriate (weigh up speed versus array benefits of automatic calculation). The individual formula approach has the added benefit of being easier to debug and setup.

If you want to keep array formulas (and I hear ya!) consider archiving historic data periodically (see no. 21 below), to keep the live dataset manageable.

^ Back to top


13. Import Formula strategies for slow Google Sheets

The ImportHtml, ImportFeed, ImportData, ImportXml and ImportRange formulas pull data from sources external to your Google Sheet, so they require an Internet connection to function.

Theyre slower than other functions that operate entirely within your single Sheet, so they will potentially affect the performance of your Sheet.

For example, using ImportRange to import large amounts of data from another Sheet will take time and you may see the Loading error message for a while:

Google Sheets share only one row

The IMPORTRANGE is a slow formula because its connecting to another Sheet to retrieve data. In general, its best to minimize the number of these external calls required.

However, when your data starts to get really big (around 20,000 rows), the IMPORTRANGE formula will just get stuck at the Error Loading data... stage.

In this case, use multiple ImportRange calls to retrieve your data.

Combine them into a single formula using the { ... ; ... } array notation, for example in this formula which gets the first 15,000 rows and then the next 15,000 (up to 30,000) from Sheet 1 of our source Sheet:

={ IMPORTRANGE("https://docs.google.com/spreadsheets/d/1UrtOONA8B2pNYCI1byDA__R9_Bbz0GWrfxP_MDotaTY/edit#gid=1789207765","Sheet1!A1:E15000") ;
IMPORTRANGE("https://docs.google.com/spreadsheets/d/1UrtOONA8B2pNYCI1byDA__R9_Bbz0GWrfxP_MDotaTY/edit#gid=1789207765","Sheet1!A15001:E30000") }

Other Notes

Note, youre limited to a maximum of 50 of ImportData functions in a single spreadsheet (link).

None of the other Import formulas have an explicit limit like this on their help pages and some limited testing suggests that if there are any limits, theyre certainly greater than 50.

By default, these functions recalculate as follows (see documentation):

  • ImportRange: Every 30 minutes
  • ImportHtml, ImportFeed, ImportData, ImportXml: Every hour

^ Back to top


14. Google Finance Function strategies

The GoogleFinance function is another function that retrieves data from an external source, so requires an internet connection. Like the Import formulas above, it will be slower than regular functions operating inside your Sheet only.

Again, the general strategy here is to reduce the number of external calls you make with GoogleFinance function, i.e reduce the number of GoogleFinance functions you use.

So think about retrieving a whole year of stock prices with a single formula, rather than hundreds of daily functions for example.

Per the documentation, GoogleFinance data may be delayed up to 20 minutes.

^ Back to top ^


15. Use IF statements to manage formula calls

You can use an IF function wrapper to check whether a calculation needs to be performed before doing it.

Example

Say for example you have a table of product data that includes books, and you want to use a VLOOKUP function to bring in book sales data alongside each book.

So you set your VLOOKUP up to search for the ISBN number (the books serial number) in the sales data table and return the sales value. The inefficiency comes because youre searching for all your products, not just books, so all those products that have N/a in the ISBN column are still be searched for.

Instead, check first for the ISBN number and then only perform the lookup if you have a valid ISBN.

The formula could look something like this, where you first check that the ISBN lookup value is not equal to N/a:

= IF( A2 <> "N/a", your_vlookup , "Not a book")

or more generally:

= IF( test , calculation_if_test_true , output_message_no_calc )

^ Back to top


16. Manage expensive formulas with a control switch in slow Google Sheets

Use a control switch cell with the IF statement method from above, to keep things manageable.

Use data validation to create a drop-down menu in a single cell, the control cell, with values Process and On Hold (or whatever makes sense for you).

Then use an IF formula like this to only process the performance-hungry formulas in your slow Google Sheets when you want to:

=IF( $A$2 = "On Hold" , "On hold" , your_formula_here )

Heres an example of this control switch technique applied to some performance-hungry Instagram IMPORTXML formulas (for the top 25 accounts):

Google Sheets share only one row

^ Back to top


17. Use Filter, Unique and Array_Constrain functions to create smaller helper tables

The Filter function, Unique function and Array_Constrain function all accept ranges (tables) as inputs and return ranges (tables) as outputs, that are smaller than the input tables.

Thus they are useful to create helper tables for further data analysis work.

Say you had a table with 100,000 rows of data in, but were only interested in performing calculations on a subset of that data, then you could use one or more of these functions to reduce the size of your table and create a new helper table for your calculations.

For example, you might use the Filter and Unique functions to create a helper table from a dynamic subset of your larger table:

=UNIQUE( FILTER( A1:E100000 , B1:B100000 < 100 ))

or using Array_Constrain to create a helper table from a static subset of your larger table:

=ARRAY_CONSTRAIN( A1:E100000 , 10 , 4 )

^ Back to top


18. Avoid Long Calculation Chains

By long calculation chains, I mean cells that reference each other in a long chain, for example a long column of cells equal to the cell above, like so:

Google Sheets share only one row

I created a column with 100,000 copies of this formula, referencing the cell above, and it was NEVER able to show all of the formula answers, even though the underlying formulas were showing in the cells.

I had to close the file, wait a moment and re-open to see the completed results.

Interestingly, this blank cell issue always occurred at the 99,100 occurrence of the formula. Here you can see the formula referencing the cell above (A99102) but not showing the value 1 like the cells above are showing:

Google Sheets share only one row

(I hit this 99,100 limit in all the various chaining tests I did, which makes me think its some kind of limit to what Sheets can handle for linked cell calculations.)

Its slow and may not even complete the calculation under certain conditions.

Aside from that, its also very bad practice to chain calculations like this. One error will cascade through the entire chain and its also difficult to debug.

A better practice would be to reference a single cell with absolute references and then copy that down your column, e.g.

= $A$2

^ Back to top


19. Reference data on the same Sheet

Referencing data in the same sheet keeps things simple always a good practice and saves time because your formulas can access the data more quickly.

Obviously its not always practical or convenient to reference data in the same tab of your Google Sheet, but keeping references within your one file will be quicker than using IMPORTRANGE to bring in data form other Google Sheet files.

That said, below I discuss the pros of splitting up large, slow Google Sheets (see no. 21 below) and using IMPORTRANGE to bring them back together as necessary.

^ Back to top ^


20. Use helper columns

Tempting as it is to create clever formulas that do everything in one go, there are many advantages to creating helper columns. Not only are they easier to create, theyre easier to follow (for you and colleagues), easier to debug, and they can even be faster sometimes too.

Suppose you have a list of a websites URLs in column A and you want to quickly extract the path, the part of the URL after the www.website.com address.

You might use this formula in column B:

=RIGHT( A1 , LEN(A1) - SEARCH( ".com" , A1 ) - 4 )

Now, since the hostname is the same in each case in this example, were needlessly calculating the nested SEARCH function every time.

We could run this once, figure out that our hostname was 24 characters long (and store this in a helper column to ensure best practices), and then replace the SEARCH function with this constant ( 24 digits + 4 digits for the .com):

=RIGHT( A1 , LEN(A1) - 28 )

^ Back to top


21. Split your slow Google Sheet into separate Sheets

First of all, it may be time to consider warehousing your data in a proper database and not Google Sheets if you are getting close to that 10 million limit (see no. 27 below).

Assuming were sticking with Google Sheets though, it might be time to split up your huge dataset into separate Sheets if your Sheet is so slow that its frustrating to use.

This technique should be approached with CAUTION though, to avoid data loss. Only do this if youre confident you know what youre doing and youre sure you really need to.

Be aware that this approach comes with a cost also. Before you had one single table to keep track of, to modify, update and analyze, whereas now, if you split it up, youll need to keep track of multiple Sheets and ensure that changes and analysis are consistent.

A safe bet for this approach might be to offload prior years of data say, or old products that are no longer in your inventory. In other words, its data we dont envisage using again, but that we want to keep a copy of.

How to safely split up slow Google Sheets

The best approach to split up your really big Google Sheets is to make new copies, label each Sheet clearly and then delete all the data apart from the data relevant to that Sheet. For example, if youre offloading data from 2015 into its own Sheet, then here are the steps:

  • Make a copy of the master Sheet, with all your data in
  • Name this new Sheet and include 2015 somewhere in the title
  • Sort the data by year in this new Sheet
  • Add a filter and show everything except 2015 data (i.e. hide the 2015 data)
  • Delete all these rows
  • Remove the filter to leave only the 2015 data

Once youve completed all the steps for all your archived data, youll want to remove it from your master Sheet. Id advocate keeping a full copy of your master Sheet before you start deleting any rows of data though.

Youll end up with a master Sheet that just has your current, or live, data in it, and itll hopefully be much faster.

You can also do any calculations or data analysis locally and then bring the data back together in your master Sheet using the IMPORTRANGE formula.

^ Back to top


22. Use Conditional Formatting sparingly

Conditional formatting is a super nice feature for adding extra context to your Google Sheets, for example highlighting outliers or values above thresholds. I use a lot in my scheduling sheets to highlight the row for the current day for example.

However, it can be very slow on large datasets because its implemented on a cell-by-cell basis.

So its best used for small data tables and in your presentation tables and dashboard reports.

^ Back to top ^


23. Leverage the power of Apps Script on slow Google Sheets

Apps Script is a Javascript based scripting language that can be used to extend the functionality of Sheets (and interact with other Google services). Check out this Beginner Guide to Apps Script if youre new to it.

The possibilities here are extremely broad, encompassing everything from automating repetitive processes to speed up your workflow to creating custom functions to save you typing out complex formulas over and over (see next section).

Apps Script is extremely effective at doing big batches of calculations, especially repetitive ones, often more quickly than thousands of regular formulas.

Example

Imagine I have a column of numbers that I want to classify into Small, Medium and Large using a nested IF statement like this:

=IF( A1 > 500 , "Large" , IF( A1 > 250 , "Medium" , "Small" ))

This took about 6.5s to compute for 100,000 rows, and about another 30s to copy and paste as values (another best practice for optimizing your slow Google Sheets see no. 6 above).

Replacing this with Apps Script and running for the same data range took around 16s to paste in all 100,000 values, so less than half the time.

Heres the code for this function:

function columnClassifier() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); var input = sheet.getRange(1, 1, sheet.getLastRow(), 1).getValues(); var output = []; for (var i = 0; i < input.length; i++) { if (input[i][0] > 500) { output.push(["Large"]) } else if (input[i][0] > 250) { output.push(["Medium"]) } else { output.push(["Small"]) }; } sheet.getRange(1,2,output.length,1).setValues(output); }

Optimizing your Apps Script code is an entirely different and gigantic topic in its own right, so I wont make any comments in this article. Note however, the current quotas and limitations applied to Apps Script code.

^ Back to top


24. Use custom formulas sparingly

Custom formulas, also known as user defined functions, or UDFs, are custom functions written in the Apps Script script editor window.

Complex custom formulas will be very slow if you approach them in the traditional function way, and read/write single cells at a time.

For example, consider this custom formula to mark up a product price by 15%:

/** * Markup a price by 15% * * @param {number} input The value to markup * @return The input multiplied by 1.15. * @customfunction */ function MARKUP(input) { return input * 1.15; }

which looks like this in use:

Google Sheets share only one row

Copying and pasting this down 1,000 rows is SUPER slow. It took me about 10 seconds, but its also dependent on your wifi connection.

What you need to do with custom formulas, to improve their performance, is think more like array formulas. The slow part of these formulas is the reading from, and writing to, the Sheet, as this happens via the spreadsheet API, so its dependent on your wifi connection.

Its best to minimize the number of read/write calls to your Sheet if you can.

Say you want to perform a calculation on 10,000 cells, then youll be better off reading all 10k cells into your function once, performing the calculation and then outputting back to your Sheet in one go, as a range.

For example, change the above formula to this more general one, which accepts a range input and outputs a similar sized range:

/** * Markup a price by 15% * * @param {number} input The value or range to markup * @return The input multiplied by 1.15. * @customfunction */ function MARKUP_RANGE(input) { if (input.map) { return input.map(MARKUP_RANGE); } else { return input * 1.15; } }

This will perform the same calculation on 1,000 cells in under a second, which is significantly faster. This is how it works in practice, accepting the whole range as the input now:

Google Sheets share only one row

Note: Custom apps script formulas are recalculated only when their arguments change. Also, these arguments must be deterministic, i.e. not one of the volatile functions like NOW() or RAND(). If your custom function tries to return a value based on one of these, it will display Loading... indefinitely.

Read more about custom function optimization on the Google documentation.

^ Back to top


25. Other troubleshooting tips for slow Google Sheets

Sometimes it might not be an issue with Google Sheets thats causing the slow response time. Its worth trying these strategies to see if any resolve your issues:

> Close and re-open the Google Sheet (sometimes its the simplest fixes that work).

> Refresh your browser.

> Clear your cache and cookies.

> Try another browser or operating system. Make sure both browser and operating system are currently running on their latest version.

> Disable browser plugins or extensions.

> If possible, try replicating the issue on another computer to see if its the computer hardware having issues. A Google Sheets calculation speed depends mostly on the local resources.

> Try replicating your issue on another wifi network to see if it is a network issue. Most functions are run locally in the browser but some, like the IMPORT formulas, require access to the Internet (as well as any Apps Script which is run on Google servers).

> Try disabling and re-enabling offline access.

> Try a faster computer perhaps ¯\_(ツ)_/¯

^ Back to top


26. Understand changes in the cloud take time to propagate

Remember that if youre working in real-time with other collaborators, changes can take a few moments to synchronize.

Other users and any apps script files will be seeing a cached version of the Sheet until all the synchronization operations are completed, and this may affect how certain cells appear. For example, they may well have finished calculating in your Sheet but still be showing blank or #N/A in the view a collaborator sees.

Just something to keep in mind, and honestly, its a very minor point. In my experience it all happens so quickly that it does feel almost instantaneous, although again really large, slow Google Sheets will suffer from this more.

^ Back to top ^


27. Know when its time to move to a database

There will come a time, and perhaps youre already there, when you have to admit defeat and accept that Google Sheets wont fulfill all of your data needs. For all of its strengths, of which there are many, that 10 million cell limit fills up pretty quickly with real-world data.

Well before any of your production Sheets approach the 10 million limit you should think through the next steps beyond slow Google Sheets.

Youre going to want to move your data into a database archive. You can still work in a Sheets environment but offload the data storage to a dedicated database.

Google Database Options

Within the Google ecosystem, were talking about BigQuery and Cloud SQL, both cloud databases. However, the integration isnt simply drag-and-drop anymore, so youll need development skills to connect these services.

Ive written a guide to help you get started with Google BigQuery:

Beyond Sheets: Get Started With Google BigQuery

With your data in BigQuery, enterprise level Google Workspace accounts can use Connected Sheets to analyze that data, even if it has millions of rows!

^ Back to top


Google Sheets share only one row
Conclusion

Thats all folks!

Ive tried to make this post as exhaustive and as useful as possible, but Im absolutely sure there are more ideas out there.

I welcome any comments and thoughts on this topic. Think of this post as a living, breathing article to which more will hopefully be added in the future.

Thanks for reading and I hope the insights contained herein have been valuable!

(This post contains some affiliate links, which means I earn a small commission on any signups for the products mentioned in this post. I only do this with products I personally use and believe in.)

Google Sheets share only one row
18 best practices for working with data in Google Sheets
This article describes 18 best practices for working with data in Google Sheets, including examples and screenshots to illustrate each concept in action.