Is there a maximum number of named ranges in google sheet - google-sheets

I am writing a Python program to extract values from a google sheet and I am running into a weird problem whereby named ranges that I know I have put in to the sheet starts disappearing. When I re-enter them, some other range disappears. This has happened after I have added a large number of named ranges. I don't get any error message and it is seems somewhat random which ranges disappears. Could it be that there is a maximum number of named ranges and that some old ranges are removed automatically when I add a new one? I have search for any maximum number in the documentation but haven't been able to find one.

Yes, there is. Currently nine hundred and ninety nine (999).
'Suck it and see' courtesy Jacob Jan Tuinstra.

Related

Google sheets max cells limits and mitigations

I'd read online that Google sheets has a max cell limit of 5 million cells. A sheet that I'm currently working on has well and above passed that limit (including blank cells).
What is the new limit?
Also I'd manually checked how many cells I was using. Is there any
function or script that I can use to keep a check?
The sheet I'm working on is going to only get bigger and it's already lagging heavily. I'd love some suggestions on which platform I could move to next to handle such big data. There are so many options, it's mindboggling. I use Google sheets mainly for it's ease in collaboration, presentability and ease of use. Any other tool with these traits but with an ability to handle bigger data?
in the early years, it was 5 million cells. last year this was upgraded to 10 million cells
you can follow updates at: https://workspaceupdates.googleblog.com/search/label/Google%20Sheets
try:
take a look on Google DataStudio
The easiest way I found to check the cell limit was to try and add a huge amount of lines at the end of the document, which gave me this error message:
This reads: "An error has occurred: This action would increase the number of cells in the worksheet above the limit of 10000000 cells".
However, when I used one more digit, I got a different message:
That one reads: "Oops, enter a number between 1 and 5000000", suggesting the maximum number of rows you can have is 5 million, while the max of cells can be up to 10 million. I'm not sure about the columns, but I'd say it is the as the row's limit.

Sum of values generated by ARRAYFORMULA() is incorrect (Google Sheet)

I have a sheet used to calculate worked time. The aim is to sum up the hours and divide them in "regular" ones (up to 8h per day) and "overtime" ones (anything more than 8h per day). Each date has to have two rows(the second one is hidden by default), as there are multiple places I can work at, but the time calculated should be summed. Also, time worked on Saturday and Sunday should always be counted as overtime.
Screencap here.
The problem I have is with calculating overtime hours.
Regular hours are generated by:
=arrayformula(IFS(
WEEKDAY(A3:A70; 1)=1;0;
WEEKDAY(A3:A70; 1)=7;0;
E3:E70+E4:E70>8;8;
E3:E70+E4:E70<=8; E3:E70+E4:E70))
They are summed by =SUM(IFERROR(G3:G71;0)), which works just fine. Overtime hours are generated by:
=arrayformula(IFS(
WEEKDAY(A3:A70; 1)=1;E3:E70+E4:E70;
WEEKDAY(A3:A70; 1)=7;E3:E70+E4:E70;
E3:E70+E4:E70>8;E3:E70+E4:E70-8;
E3:E70+E4:E70<=8; 0))
And summed similarly by =SUM(IFERROR(H3:H71;0)) in H72. However, it returns a wrong value - in the sample sheet, it is 57 instead of 7
If I select the summed range, the tooltip shows the correct sum (7). If I add/remove the decimal place or change the formatting in H72, it suddenly changes to the correct one, too. However, when any new data is added (i.e. hours form a new day), it goes back to showing incorrect values.
It is not a simple display error, because the values are then imported by another sheet via =IMPORTRANGE and it imports those wrong values.
Any idea how to fix it?
Sample sheet here
try in H72:
=INDEX(SUM(IFERROR(1*H3:H71;0)))
update:
=INDEX(SUM(IFERROR(FILTER(1*H3:H71; MOD(ROW(H3:H71)-1; 2)=0); 0)))

How to calculate the difference between two "elapsed" times with Google Sheets

I have two columns in Google Sheets, column 1 is a list of my times around a track in the format "01:23.456" or "minutes:seconds.milliseconds". Column 2 is a list of someone else's times around a track in the same format. I'm looking for a way to calculate the difference between my time and the other person's time to see how far behind I currently am.
I have already tried multiple different different date and time formats and even attempted to make a custom number format. I am kind of new to Google Sheets so I may have been going at this problem incorrectly.
For example, if my time around the track was "01:00.00" and the other person's time was "00:50.500" then the third column should display "00:09.500". Currently all of my attempts give me the same error which is "is a text and cannot be coerced to a number".
=TEXT(MINUS(LEFT(A1, 2)*60*1000+MID(A1, 4, 2)*1000+RIGHT(A1, 3),
LEFT(B1, 2)*60*1000+MID(B1, 4, 2)*1000+RIGHT(B1, 3))*0.001, "00:00.000")

Google Spreadsheets Repeat Function Nth Times & Sum Results

I have the following function
=IF(RAND()<0.25,1,0)
RAND() returns any value between 0 to 1 in decimal format and the idea is that an item has a 25% chance of getting a 1. If it was less than 0.25 the rand() then its a hit and gets a 1 otherwise a 0. Now lets say I need to do this 100 times and add up the sum of all the '1's that were created, which in this case will average to around 25 for 25%. How do I do this in Google Spreadsheets?
Basically looking for a way to repeat a function n'th amount of times and sum the results.
I have looked around everywhere (youtube, google forums) and have not found any solutions.
I may as well put this as an answer because it tries to address the broader question of whether you can repeat a function (say) 100 times. The answer is, yes if the function is compatible with an array formula. Rand can't be used in this way because it doesn't take any arguments (neither do some other functions like countifs for some reason). But you could get round it by using Randbetween instead and providing it with 100 array elements. These are multiplied by zero so don't actually affect the answer, but Google Sheets still evaluates the function 100 times:
ArrayFormula(sum(if(randbetween(0,A1:A100*0+99)<25,1,0)))
or
=Sumproduct(if(randbetween(0,A1:A100*0+99)<25,1,0))
The result is each time you force this to re-calculate (by changing something in the range A1:A100 or by setting File -> Spreadsheet Settings -> (Tab) Calculation -> Recalculation to every minute) it will give an answer around 25.
To make it more resilient (allow any value in A1:A100 including error values) could try
=ArrayFormula(sum(if(randbetween(0,iferror(A1:A100/0,0)+99)<25,1,0)))
or
=Sumproduct(if(randbetween(0,iferror(A1:A100/0,0)+99)<25,1,0))
I don't know why I didn't do this in the first place
=ArrayFormula(sum(if(randbetween(0,row(A1:A100)*0+99)<25,1,0)))
then this easily allows for a variable range
=ArrayFormula(sum(if(randbetween(0,row(indirect("A1:A"&H1))*0+99)<25,1,0)))
where the number in H1 doesn't have to be limited to the number of rows in the sheet.
Okay so I found a very convoluted answer. If someone finds a better please let me know.
The first thing as the user |'-'| commented was to create a range on separate sheet.
Since I know that I will not be looking up more than 200 values at once I created my range to be 200 long of this formula.
=IF(RAND()<0.25,1,0)
This will create the initial list of random values.
The next step is you need to generate a randomizer seed. Which is basically a random number between the range you created. You can do this with
=RANDBETWEEN(1,200)
This should be on the same column as what you are trying to sum up later.
Next you want to create a dynamic string that you can access via arrayFormula later.
="Randomizer!B"&B12&":B"&B12+B3
In my case I had the 200 random numbers on a sheet called randomizer. Notice the &, this is how you connect strings. In my example B12 is the reference to the =RANDBETWEEN(1,200), and B3 is how many times I want the randomness to occur. It can be any value as long as it's less than the randomizer seed by the amount of times you want it to be random.
Finally refer to this string using, =SUM(ARRAYFORMULA(INDIRECT(B13))) , indirect lets you refer to a string as a cell and this is how I was able to create a dynamic range to calculate from.
I will say the advantage of this method is its super fast to calculate since the random numbers have been pre-computed.
The idea is that it will keep creating random ranges from the precomputed random numbers you created, and then summing those ranges, essentially calculating random numbers n'th amount of times.
Hope this helps someone.

Google Sheets: Add value to total if a row condition matches for infinite column

I am attempting to make a Google Sheet that has a column for a rate and a value of that rate. Each night I am adding a new value to the bottom of this list so I want it to continue as an infinite list. What this sheet should do is look down the list of rates, if the rate matches a predefined rate, it should add the corresponding value to the total for that rate. I have four common rates that occur in no particular order and with some given value. I would like to total the values for each of those rates and give them in the totals section so each rate can be easily referenced.
Is there a way to do this using Google Sheets built-in commands? Pseudocode would be something like IF(A2:A = rate, add value in B to total). I know to make an infinite reading of a column by A2:A, but I don't know how to check each value as it goes through that column. I have attached a test spreadsheet with some sample values and the output that should be given by the formula. Thank you in advance for your help.
https://docs.google.com/spreadsheets/d/19k1DMipSsI9tWSjTXrVAPzPoaenWS6WYmlwe201_WQk/edit?usp=sharing
I managed to discover my own answer using the SUMIF statement. My code for the rate of .75 is ""=SUMIF(A2:A,"=.75",B2:B)"". I ran into some more trouble with the section for a different rate because I was having trouble saying not equal to .75 or 1 or 1.5 or 1.75. I solved this problem by completely bypassing it and adding the all the values and subtracting away the values already added. I would still like to know how to give the list of "ors" if someone could shed some light on this. But I now have a working solution regardless. I have updated the test sheet to show the solution.

Resources