COUNT.IF built-in functions in Google Sheets do not update calculations after my script run.
The script (invoked by a custom push button) take values from an input mask (in another sheet), in order to insert a line in the summary sheet, which is fed by input mask data. In another sheet, where a series of COUNT.IF formulas should report the current situation, nothing happens.
The only way to refresh data is manually copying formula from another cell.
Auxiliary Notes:
main menu automatic calculations option is regularly set.
I inserted in the script the re-copying of all COUNT.IF formulas and the FLUSH instruction, but never changed.
The COUNT.IF formulas not updating are pointing to dates, which are converted into strings, since there are strings in the summary table to be counted. I am afraid this is crucial, because other COUNT.IF formulas not involving dates regularly update.
How can I get an automatic refresh of such COUNT.IF column or what am I getting wrong?
Update required by TheMaster: below the capture of the formula. (I am sorry for the "italian" but I think so is enough clear).
Formula in F3
"COUNT.IF" is in italian "CONTA.SE", while "SE" stands for "IF".
Dates are in the B column, and are pointed by the F column formulas in order to be converted into text and counted in the "colAppuntamenti" summary range.
Related
I'm working on a spreadsheet that has many links with the general value, and I need to update this general value daily for this update, I need to remove the links from the formulas and copy only the values โโof the cells, this part I did, but the cells that do not have values, I need to put the formula that makes the link with the initial value again.below is the script where you copy and paste the formula, I'm trying to do it with the IF formula, but when I run the script, it doesn't copy and paste in the range I need, but where is the active cell, what am I doing wrong?
I tried to do the while command, the for command among others, but without success, this one is almost ready, I just need to glue it where I need it.
*Let's start with the Set-up. I am working on a program that assigns employees inspections based on who is the closest from their last job. The issue however it this program uses the TODAY function, which constantly updates. This wouldn't be a problem except once it is no longer TODAY, the optimization loop I've created pulls new values, meaning that jobs now previous to the current date will show as blank in the inspector column. In other words, once a date moves into the past we will have no record of who was assigned to it, which makes following up very difficult.
Here is what I need help to make happen.
At 5pm, I want cells in column E to take a snapshot of the value of the corresponding cells in column D for dates that equal TODAY.
Ideally I want this to be a custom function so I can make it dependent on the cell reference of the date code for TODAY.
(Such As in Cell E2: IF(B2=TODAY,"CUSTOM FUNCTION CAUSING SNAPSHOT of D2 Triggering # 5pm"," ")*
Schedule Sheet Picture
This is the problem I was seeking to solve. I after over a week of unassisted work, I was able to do what other posts and users deemed impossible without using App Scripts.
SOLUTION, ENTERED IN COLUMN P
=IF(O13="Automatic",IF($X$4<=L13+$Z$4,N13,P13),O13)
Column O gives me control of whether Column P displays the Automatically assigned inspector (Column N), or if it uses a Manually selected one, located in a dropdown menu of Column O.
X4 is a cell reference to a NOW() Function
Column L allows only dates
Z4 is a cell reference to a trigger time, which can be updated to any valid time.
Also note: To make this work, the spreadsheet settings must be adjusted. Make sure the timezone is correct. Enable iterative calculations. And set the spreadsheet to update on edit and by the minute.
All of this comes together to form a cell reference that will defer to the manual assignment when used, but will otherwise actively reflect the contents of the corresponding cell in column N until the trigger time, where in the code loops back on itself, resulting in a snapshot of the value that remains even after the program erases the values in column N
the sheet I'm working on generates a request number on the very first submission a user makes of a google form based off of information the user inputted in the form and a timestamp. Now, because I need for the user to be able to edit their response later which causes the form to be re-submitted, I want the request number not to be regenerated, and to stay the same as when it was initially generated. Is there any way to prevent a cell from changing from its initial value when it contains a formula that references a cell that updates?
Here is the formula contained in the cell I don't want to update with alongside its references:
=ARRAYFORMULA(ARRAY_CONSTRAIN(if(ROW(A:A)=1, "Request ID", if(D1:D="", "",C1:C&"-"&G1:G&"-"&N1:N)), MAX(if(D1:D="",0,ROW(D1:D)))-ROW()+1,1))
The formula appends different values received from the form together to create a request number (formatted as essentially C1:C-G1:G-N1:N, timestamp-System-initials) and the arrayformula and constraint ensures the formula is copied to each row in the sheet that contains a form response so far. I want this request number to stay the same as it's initial value, even as columns C, G, and N change.
Edit: Not really sure how I can provide a search history on what I've tried so far because I've been searching for anything I can to fix this problem because it's important. I've looked into indirect referencing, absolute references, considered using PropertiesService (Google Apps Script) in order to store whether the request number has been initiated before and got stuck there, considered copying the value into another column to store it but again the autoupdating feature that accompanies linking cells of course still remains an issue. I'm stuck on what kind of function/workaround I could use to achieve this. Look forward to your thoughts. I've also tried a number of other strategies as well.
Since formulas recalculate each time the spreadsheet is recalculated using a formula is not the right way to keep the original value on the current spreadsheet version. The way to achieve this is by using a script to log those values.
There are already a lot of questions about using a script to log values from one sheet to another. Here are few examples
How to Get (& Set) cell values from one sheet to another in Google Sheets?
I want to write a script to read and log values of a specific row and copy them to a new sheet
I have a google spreadsheet which we use to feed inventory purchase and issue data. The only problem is my staff can manipulate purchased quantity, prices and other variables at a later date. I want that if they enter data in a cell, they cannot edit it post-midnight but I can.
Also, I have filled most of the cells with formula, for example- there is formula in A1:H999, so that when they enter data, it calculates the values in other cells, and suppose my staff has entered data till A1:H500. In this case, the script should work On A1:H500, it should not consider the whole range just because i have filled it with formula. Thanks
If you want to limit access to the script to particular hours it's fairly simple. This can be done with one function if written in a clever way or with 2 functions.
Function1 will simply lock the spreadsheet and allow only you to edit by using the protection class, then use function2 (or write function1 in a clever way to do different things depending on when it starts) that is triggered at a different time to remove that protection.
I have simple google spreadsheet with two sheets: sheet1 and sheet2. In sheet2 there are time values in column A which I am trying to copy to column A in sheet2. I wrote a script(please see link) for it but values are not the same. What class/method do I need to use in order to get same values in both sheets.
I noticed if I format column A values in sheet2 to text than I get matching values but problem is I am not allowed to that and that column must remain formatted as time.
Also, my second question(please ignore if its off topic). If I have work schedule in google sheet for 3 employees: John,Peter and Mike and they all have editing permissions. If Mike decides to use filter to filter out just his work schedule, is it possible for other two employees to have unedited sheet(as I believe Mike's actions will affect other two persons). What I mean is, is it possible to restrict one persons actions just to view he is looking at while other have unaffected version(together work schedule in this case)?
link for spreadsheet:
https://docs.google.com/spreadsheets/d/1tOtwzM0CxDHBXzC8ECeXlfaTGC4i7rH2XMYYszqRINM/edit?usp=sharing
Much appreciated.
not entirely sure what the problem is, your script is working as intended and you have the same values in sheet1 as in sheet2. The only difference is that in Sheet1 you have a date format and on sheet2 you only indicate the time. I have changed the number format in the sheet1 and as you can see it's the same.
The problem you are having is that by indicating only the time, you let the sheet assume any date. For time it's not that big a deal, but you must be sure that time formats are the same. use getNumberFormat() and setNumberFormat() (read here) to set the correct formats when copying or have the formatting set in advance
As for filtering โ you can simply give them view-only access and let them use filtere views (right under "Filter"). A filter will hide information for everyone on the sheet, while a filter view will only be visible to that person. You can also pre-set filter views for them as those with edit access can save filter views.