text
stringlengths 83
79.5k
|
---|
H: If cell values match a string, add some values
I have a Spreadsheet that I want to send to a group of people, where each person has their own row and they choose what options they want with a checkbox (Using a Data Validation drop down containing either ☐ or ☑).
Basically what I want to do is check if an option is selected and use a value from elsewhere to calculate the total for each user. It is possible that more options would be added in the future so I need to be able to extend the options table.
I have an example sheet here.
I have already attempted it using the following:
= IF( AND( D3 = "☑" , J3 = 'DO NOT CHANGE'!B2, D3) , IF( AND( D3 = "☐" , J3 = 0)))
My hope was that this would assign J3 a value from the price list on a seperate page and then I could SUM the J column for the first user, K column for the second etc. and display the result in the Price cell for each. But this isn't working.
AI: You can use arrayformula with SUM to do look up only the needed values like this:
=SUM(ARRAYFORMULA(if(B2:D2="☑", vlookup($B$1:$D$1,G:H,2,false),))) |
H: Is it possible to set Google Drive to open Google Docs above a certain age in Viewing Mode automatically?
Sometimes, I like to go back into my old school files and read the terrible essays I wrote in high school. However, on occasion, I will accidentally hit a key while reading, and this changes the edit date to way after the date on which I last worked on the document.
Google Docs, Sheets, and Slides have three view modes: Editing, Suggesting, and Viewing. The first two cause the file to accept input, which changes the edit date. Viewing Mode, however, displays the file in a read-only state, making it impossible to make (or suggest) changes accidentally.
Since I see many of my old Google-format files as "archived" in my Drive—heck, I have a massive folder named "Archive"—I would love to be able to open files last edited before a certain elapsed time—say, a year ago—in Viewing Mode so as to protect them from twitchy typing fingers.
Is there a way to enact this behavior using Apps Script? or some other way? Or do I just need to back away from the keyboard and mouse any time I want to read an old document or spreadsheet?
AI: Short answer
Google Apps Script can't modify how the Google Drive UI behaves, but it already has features to open file on preview mode.
Alternatives
To open a file of the Google Docs editors type in preview mode,
Alternative 1: Right click the file and select Preview
Alternative 2: Select the file and click the preview button on the Google Drive toolbar |
H: How to enter leading Tab in Google Docs
I have two images and two labels:
|--------------| |---------------------|
| | | |
|--------------| |---------------------|
Image1 Image2
Both labels are aligned using center tab stops. How do I enter a 'Tab' symbol as the first symbol in the line? (when I push Tab there, the indentation changes instead)
AI: Note that the problem only occurs the paragraph already has some content (text or inline images) and you try to insert a TAB at the start of the line.
Here are 3 workarounds to pick from:
Type a SPACE then a TAB. That will enter a regular TAB. You can then delete the SPACE if you wish. Or use a PERIOD instead of a SPACE to make it visible and easier to remember to delete.
Copy a TAB from anywhere in the doc, then paste it in at the start of the paragraph.
With the caret at the start of the paragraph:
Type a RETURN to insert a new paragraph before the one you want to change.
Tap the up-arrow key to move the caret to the empty new paragraph.
Type in a TAB.
Delete the newline at the end of this new paragraph, e.g. type fn-DELETE on Mac, or (I think) DELETE (instead of BACKSPACE) on Windows/Linux, or right-arrow then BACKSPACE. |
H: Turning off email notifications for individual group posts on Facebook
I am in a group and someone tagged me in a post and I got an email notification, this is fine and what I want.
However, what I don't want is email notifications every time someone else replies to this post, which I keep getting, I would only want an email notification if they had directly replied to me.
Now I see you can turn off notifications to individual posts such as:
However I am unsure if this turns off email notifications completely and won't notify me now if someone tags me again or someones replies directly to me; I'm guessing it turns all notifications off.
Is there any way to do what I want?
AI: Unsubscribe directly from your email for which you don't want to be notify.
Suppose someone else replies to the post, you will get an email, unsubscribe that one. |
H: Using MAX in conditional formatting only evaluates numbers after the cell, regardless of range
I would like to highlight the maximum numerical value in a particular column.
Take a look at this sheet: https://docs.google.com/spreadsheets/d/107c-9pET6SA1APwtGIJh1Qxi__SOXAHGtaGVGd5Nw6g/edit?usp=sharing
Or this screenshot:
This formula seems to actually be taking A2 and replacing it with the cell being calculated. In other words, it's only checking this cell and all cells after it to find the max, and no cells before it.
How do I make sheets check all cells?
AI: Insert $ between A and 2 in the formula. As CF 'steps through' to test each cell in the range in turn the range is being automatically adjusted. So when for example testing A9 it is checking for the maximum in A9:A1007, which is indeed 14 - so it formats it. |
H: How do you add a Google Maps route to "My Maps"?
After creating a route I'm happy with, how do I save it to "My Maps"? I used to know how to do this but things look different now.
I found directions which seem to be out of date: https://www.techwalla.com/articles/how-to-save-directions-from-google-maps
There, I read
Scroll down to the bottom of the driving directions. Click "Save to My Maps."
But when I scroll down to the bottom of the driving directions, I don't see "Save to My Maps."
AI: Once you've chosen a route, after you click on "Details", you have a couple of options:
Send to your phone
Depending on your device, you can get the directions sent to the Google Maps on your phone, sent to email, or sent via text
Share
a link
code to embed a map on a web page
Print
with or without mini maps
It seems to me that the simplest option for coming back to directions later is to get the link and save the link somewhere. There is even an option to shorten the link, so you can get something like https://goo.gl/maps/unAMRv2oXQL2 instead of https://www.google.com/maps/dir/Mets-Willets+Point/Sag+Harbor,+NY/@40.8383632,-73.6327663,9z/am=t/data=!4m13!4m12!1m5!1m1!1s0x89c25fdf0a2e25f3:0x3abb28977780008d!2m2!1d-73.8437!2d40.75239!1m5!1m1!1s0x89e8bd23cca70ca7:0xd8ff0f5b96c0899d!2m2!1d-72.2925819!2d40.9978773 |
H: How can I make "Pop out reply" the default behaviour to reply to an email in Gmail?
I would like to make all my replies in Gmail "Pop out" replies such as shown in the screenshot below. Is this somehow possible?
Screenshot:
AI: I just learned that by holding down Shift while clicking the Reply button, you get the pop-out window you want.
Also, keyboard shortcuts let you easily open a pop-out menu for replies.
(If you haven't yet enabled Gmail keyboard shortcuts, click the Settings cogwheel, select Settings from the menu, scroll down to Keyboard shortcuts, and select Keyboard shortcuts on.)
With keyboard shortcuts enabled, when viewing a message in Gmail, pressing R opens the reply area below the message.
Instead of pressing R, press Shift+R, and the pop-out reply window appears instead.
Source: https://support.google.com/mail/answer/6594 |
H: Trying to use Google Sheets importHTML() to import a table. It forces content to a date format
I am trying to get a table into a sheet. The table contains data that looks like this:
4-0-2
This is wins-losses-ties. It comes in as a date. This is the command I use:
IMPORTHTML("http://www.sportsnet.ca/hockey/nhl/standings/", "table")
This is the site:
http://www.sportsnet.ca/hockey/nhl/standings/
I have tried reformatting things in the sheet, but the damage has been done.
AI: Formulas
For columns 1-10
On cell A1 add the following formula:
=ARRAY_CONSTRAIN(IMPORTXML("http://www.sportsnet.ca/hockey/nhl/standings/",
"(//table)[1]//tr"),2000000,10)
For columns 11-13
On cells K1 to M1 add the following formula on each cell
=ArrayFormula(
TEXT(IMPORTXML("http://www.sportsnet.ca/hockey/nhl/standings/",
"(//table)[1]/*/*/*["&COLUMN()&"]"),"d-m")&
IF(ISNUMBER(IMPORTXML("http://www.sportsnet.ca/hockey/nhl/standings/",
"(//table)[1]/*/*/*["&COLUMN()&"]")),
"-"&right(TEXT(IMPORTXML("http://www.sportsnet.ca/hockey/nhl/standings/",
"(//table)[1]/*/*/*["&COLUMN()&"]"),"y"),1),)
)
For column 14
On cell N1 add the following formula
=IMPORTXML("http://www.sportsnet.ca/hockey/nhl/standings/",
"(//table)[1]/*/*/*["&COLUMN()&"]")
Explanation
IMPORTHTML and IMPORTXML assigns the data type before adding the values to the spreadsheet.
The formulas shown on the previous section could be used as a workaround.
See also
IMPORTXML() Importing Data as Date |
H: Summing top three values in a column from a Google sheet
I have a Google Sheet with a variable number of data rows. I would like to sum the three highest values from a certain column, but they won't necessarily be in the top three cells. An empty cell should be treated as zero, if there are only one or two rows with data so far.
How can I achieve this? The closest thing I can think to do is MAX(A1:A2000) but that only gets the one very highest value, without accounting for the second- and third-highest.
AI: Formula
=ArrayFormula(SUM(IFERROR(LARGE(A1:A2000,{1,2,3}),0)))
Explanation
LARGE returns the nth greater element.
IFERROR if the first argument returns an error, returns the second argument.
{1,2,3} is an array of literals. See Using arrays in Google Sheets.
ArrayFormula makes that functions like LARGE and IFERROR return an array of values. |
H: Prefill a Google Form link using data from spreadsheet with text masking
I've been struggling with this for a few weeks and have gone as far as I can with my limited knowledge of formulas (and my totally absent knowledge of scripts).
I'm trying to create a prefilled link to a Google Form filled with data contained in a Google Sheet (done).
The prefilled link should be easy to replicate over thousands of rows by simply dragging the hyperlink formula, making it unique to the data contained in each row (done).
The prefilled link should be masked in the sheet by text, the way any other hyperlink is masked by text (not done).
Steps 1 and 2 work like the example below and populate the form quite nicely:
=HYPERLINK("https://docs.google.com/forms/d/e/1FAIpQLSf7_ZUEXce6RTvHxzsIIMnUrOj2bcdIh9WSGG1V_0LHlM8QDg/viewform?entry.1079682270&entry.13269831&entry.106264669=="&A2&E2)
=HYPERLINK("https://docs.google.com/forms/d/e/1FAIpQLSf7_ZUEXce6RTvHxzsIIMnUrOj2bcdIh9WSGG1V_0LHlM8QDg/viewform?entry.1079682270&entry.13269831&entry.106264669=="&A3&E3)
But I would like it to also be masked by text as is done in a typical hyperlink formula:
=HYPERLINK("https://docs.google.com/forms/d/e/1FAIpQLSf7_ZUEXce6RTvHxzsIIMnUrOj2bcdIh9WSGG1V_0LHlM8QDg/viewform","Reserve Now")
If anyone can help, I'd be eternally grateful! For reference, here is a link to the Drive folder showing the actual Sheet and Form I'm working with:
https://drive.google.com/open?id=0B1ww3yce65L2MUs0WVNBOW5LRnM
AI: If you add one more parameter like this:
=HYPERLINK("https://docs.google.com/forms/d/e/1FAIpQLSf7_ZUEXce6RTvHxzsIIMnUrOj2bcdIh9WSGG1V_0LHlM8QDg/viewform?entry.1079682270&entry.13269831&entry.106264669=="&A2&E2,"Reserve Now")
That will add your text.
You can also do an arrayformula:
=ARRAYFORMULA(IF(ISTEXT(A2:A),HYPERLINK("https://docs.google.com/forms/d/e/1FAIpQLSf7_ZUEXce6RTvHxzsIIMnUrOj2bcdIh9WSGG1V_0LHlM8QDg/viewform?entry.1079682270&entry.13269831&entry.106264669=="&A2:A&E2:E,"Reserve Now"),)) |
H: How to search notes in Google Sheets?
My spreadsheet has many notes added to its cells. I would like to find the cells containing a certain word, phrase or number. How to do this?
AI: It appears that built-in search does not cover notes (or comments) added to spreadsheet. So I wrote a script that searches all notes within the active sheet. (It does not search comments, since scripts are currently unable to access comments at all.)
After entering the script (Tools > Script Editor), you will see a new menu item next time you open the spreadsheet: it will be Custom > Search notes.
There is no user interface; the search term is the content of the currently active cell, and the search results are placed in that cell, replacing the term. The search results are stated as "D5: content of the note" where D5 is the cell to which the note is attached.
One can search for empty text: the result will be the summary of all notes in the sheet, which may be useful.
The search is case-insensitive.
function searchNotes() {
var sheet = SpreadsheetApp.getActiveSheet();
var cell = sheet.getActiveCell();
var searchTerm = cell.getValue().toString().toLowerCase();
var dataRange = sheet.getDataRange();
var notes = dataRange.getNotes();
var results = [];
for (var i = 0; i < notes.length; i++) {
for (var j = 0; j < notes[0].length; j++) {
var note = notes[i][j].toLowerCase();
if (note && note.indexOf(searchTerm) !== -1) {
results.push(dataRange.offset(i, j, 1, 1).getA1Notation() + ': ' + notes[i][j] + '\n');
}
}
}
cell.setValue(results.join('') || 'Not found');
}
function onOpen() {
SpreadsheetApp.getActiveSpreadsheet().addMenu("Custom", [{name: "Search notes", functionName: "searchNotes"}]);
} |
H: How can I save a Google Docs image to my local hard drive?
Is it possible to save an image used in a Google Docs document to my local hard drive?
AI: I don't know if you can do it directly.
If you have to do this one time, you can save the document on your hard drive and then save the image.
If you have to do this operation many time, you can try the Image Extractor add on for Chrome. |
H: How can I change a Google+ (Plus) community from private to public?
Is it possible to change the status of an existing Google+ community from "Private" to "Public"?
This screenshot shows that my community is set to "Private" and I couldn't find an option to change it yet.
AI: Unfortunately, you cannot.
A public community can be changed from being fully open to requiring people request to join, but a private community cannot be made public, or vice versa.
(source) |
H: Flagging/Preventing Duplicate entries in a Google Sheet
I've looked for a while now and can't quite find a way to perform the task I am attempting to in Google Sheets.
I am trying to prevent, either through data validation via custom formula or script, preventing the possibility of entering duplicate data in cells within my Google Spreadsheet. A few things to note before you provide an answer:
I need the cells belonging to each of these columns to have a character limit (first column should have 7 character limit, next column should have 17 character limit).
Each cell will contain alphanumeric characters.
I need replication of segments of data within each cell to be possible, but replication of all data within the cell to be prohibited (ex. "G123123" and "G123124" should be allowed, but not "G123123" and "G123123".
I've found some things that come close, but don't quite reach the resolution I need. Before anyone suggests using a database, please understand I'm working with technologically-challenged individuals that will not allow usage of a full database at this juncture.
These forms of data entry should be allowed (partial but not entire duplication of previously entered data):
H123124 1234567890ABCD
H123125 1234567890ABCE
H123126 123ABCD4567890
Notice: The above rows of data contain some matching characters, but not complete duplicates. These need to be allowed.
Edits:
To clarify, I'm looking for a script, or closely related script (or custom formula) that will limit characters allowed in a cell. I'm also looking for the same script or formula to not allow entirely duplicate entries in each cell. In essence, I'm looking for a way to not allow entry of duplicate data in each cell of a column, but still allow some repeating characters, as long as an entire string of data is not duplicated.
Here is a link to a spreadsheet with comments explaining what should be allowed and what shouldn't: https://docs.google.com/spreadsheets/d/1Gohyu20P_ZBlGxDwL5kr-7BymW_wY5IZ_agzFqUGiSY/edit?usp=sharing
AI: I decided to use a simpler methodology to collect similar results to resolve my issue. A custom formula must be entered under conditional formatting rules in google sheets in order to achieve this goal. Moreover, you still must select an "Apply to range:" for the columns/rows you wish to affect. The following formula can be used to highlight duplicates in google sheets across multiple columns where necessary:
=COUNTIF($A$2:$B$40, INDIRECT(ADDRESS(ROW(), COLUMN(), 4))) > 1
If you're interested in using the same formula, make sure you alter your row/column selection within the following part of the formula:
($A$2:$B$40,
This method will not truly prevent users from entering duplicate data, but will make it painfully obvious when duplicate data is entered. I'm still working on the character limitation, though that isn't as large of an issue for us. |
H: Google Apps, 50 accounts: from free to 100 GB/month for one account only
I have Google Apps free plan (50 Google accounts) and I would like to apply a different plan for one account only: from free to 100 GB/month (lots of mails, I need space).
I fear that changing plan applies the change to all accounts, increasing the monthly cost x50 times.
Is my fear founded?
AI: Yes. Unfortunately, I can't find the official documentation anymore, but a while ago I was also checking for mixing different user types in one G Suite domain, but unfortunately that was not possible.
Note also, that the free account is no longer available for new registrations, and only people who have an existing free account can continue to use it as such. |
H: Customizing notifications on Google Calendar
So far I have been setting manually a notification for all my events in Google Chrome for the previous day at 9PM. I have to manually find out how many hours that is, which is a pain.
Is there a way to customize the notifications for a specific date, instead of a number of minutes or hours?
AI: Right now, there is no way to natively customize the notification in calendar without using Apps Script. Sending the Daily Agenda might be the closest to what you want.
In the calendar with the events, click on the drop down arrow and select "Edit notifications (or, go to that calendar's settings and click on the Edit notifications tab at the top).
Scroll down to Daily agenda and make sure the email box is ticked. This sends an email at 5AM local with all of your events for the day. |
H: Set value of cells based on the value of a cell
I have a Google Spreadsheet with a set of tables acting as a "database":
http://prntscr.com/dbbkyv
A table with a number of persons having combinations of items in said database:
http://prntscr.com/dbblhy
And finally a table summing the statistics of the different items:
http://prntscr.com/dbblwe
Color code is as follows: http://prntscr.com/dbbm8w
Green cells are a dropdown list.
How could I have the sum of each stats for each person in table 3?
In this example, Person 1 should have 36 in "Stam" column, 34 in "Int" and 61 in "Spell".
Here is the Google sheet used in the example.
AI: You might try, in B21, C21 and D21 in order:
=vlookup(vlookup($A21;$A$13:$C$16;column();0);$A$4:$D$6;column();0)+vlookup(vlookup($A21;$A$13:$C$16;column()+1;0);$F$4:$I$6;column();0)
=vlookup(vlookup($a21;$a$13:$c$16;column()-1;0);$a$4:$d$6;column();0)+vlookup(vlookup($a21;$a$13:$c$16;column();0);$f$4:$i$6;column();0)
=vlookup(vlookup($a21;$a$13:$c$16;column()-2;0);$a$4:$d$6;column();0)+vlookup(vlookup($a21;$a$13:$c$16;column()-1;0);$f$4:$i$6;column();0
This is complexity purely resulting from the layout you chose. |
H: How to enter an array formula on ethercalc.org
I added the following constants
+---+---+---+
| | A | B |
+---+---+---+
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 3 | 3 | 2 |
+---+---+---+
Then on C1 I wrote the following formula
=A1:A3+B1:B3
The result was
Formula results in range value: A1:A3
On Google Sheets I could press Ctrl+Shift+Enter and it automatically puts the formula as argument of ArrayFormula function. On Excel it's required to first select the required area for the result, write the formula, and then press Ctrl+Shift+Enter.
Does ethercalc.org supports arrays formulas? How are they used?
References
Using arrays in Google Sheets Google Docs Editors Help
ARRAYFORMULA Google Docs Editors Help
Guidelines and examples of array formulas Microsoft Support
Non-Scalar Evaluation (aka 'Array expressions') Oasis Open Document Part 2: Recalculated Formula (OpenFormula) Format
AI: COMMAND() or DSUM() are maybe the closest.
But no, there is no arrayformula support yet.
COMMAND() / COMMANDIF()
These issue spreadsheet commands and can set cell values/colors. They can change anything on the sheet.
e.g. http://sheet.cellmaster.com.au/command_example
DSUM() etc
The database functions exist in ethercalc
DAVERAGE(databaserange, fieldname, criteriarange)
DCOUNT(databaserange, fieldname, criteriarange)
DCOUNTA(databaserange, fieldname, criteriarange)
DGET(databaserange, fieldname, criteriarange)
DMAX(databaserange, fieldname, criteriarange)
DMIN(databaserange, fieldname, criteriarange)
DPRODUCT(databaserange, fieldname, criteriarange)
DSTDEV(databaserange, fieldname, criteriarange)
DSTDEVP(databaserange, fieldname, criteriarange)
DSUM(databaserange, fieldname, criteriarange)
DVAR(databaserange, fieldname, criteriarange)
DVARP(databaserange, fieldname, criteriarange)
ArrayFormula() docs https://support.google.com/docs/answer/3093275
or
=sum*{1,2;3,4}) |
H: Get all unique combinations of values from two tables where a 3rd value is equivalent google sheets
I've got 2 tables and on a third table I want to have all unique combinations of table2.a, table1.b where table1.c==table2.c
SELECT table2.a, table1.b FROM table1 JOIN table2 WHERE table1.c=table2.c
In sql I would be using inner join or join (I think) but I can't seem to find a way to do this using google sheets query()
It doesn't need to join the actual keys together like I have in table3.a I have already added an arrayformula to handle that. The prefered output would be a 2d array that I can fill in table3.b:c
table1
a b c
4 7
5 8
6 9
table2
a b c
1 7
2 8
3 9
table3 (wanted output)
a b c
14 1 4
25 2 5
36 3 6
I've tried to replicate what I would use in sql to get the results I want, but to no avail as the query() method doesn't work the same.
Things I have tried.
=query("SELECT" table1!A, table2!A "FROM "table1, table2" WHERE" table1!C = table2!C) doesnt work and isn't the correct syntax
=query({table1!A2:A; table2!A2:A})
this gets me the list of both in one column,
=query({table1!A2:C; table2!A2:C}, "select Col1 where Col2='3'")
this gets me a list of all but only checks a single column (first column from both sheets) I think this is getting closer if i can find a way to set it to check a certain column from each sheet rather than the default Col1, Col2 etc.
AI: I would write a custom function for this, to be used as
=combinations(table1!B2:B, table1!C2:C, table2!A2:A, table2!C2:C)
that is, the parameters are ValueColumn1, KeyColumn1, ValueColumn2, KeyColumn2.
The logic is entirely straightforward: run a double loop and collect whatever matches.
function combinations(range1, key1, range2, key2) {
var output = [];
if (range1.length != key1.length || range2.length != key2.length) {
throw new Error('Each range must have the same length as its key');
}
for (var i = 0; i < range1.length; i++) {
for (var j = 0; j < range2.length; j++) {
if (key1[i][0] === key2[j][0] && key1[i][0] !== '') {
output.push([range1[i][0], range2[j][0]]);
}
}
}
return output;
} |
H: Comma-separated values analysis and pivot tables in Google Spreadsheets
I have an issue with comma-separated values analysis and pivot tables in Google Spreadsheets. What if I have the following dataset:
Facebook, Github Developer
No answer Developer
Github, MSDN Developer
Facebook, Github Developer
Artstation Designer
Beahnca, Artstation Designer
3DTotal Designer
As a result I want to see the following grouping:
Facebook Github No answer MSDN 3DTotal Artstation Behance
Developer 2 3 1 1 0 0 0
Designer 0 0 0 0 1 2 1
How can I do that? Please assist.
The main problem is how to transform
Facebook, Github Developer
No answer Developer
Github, MSDN Developer
to
Facebook Developer
No answer Developer
Github Developer
Github Developer
Github Developer
MSDN Developer
and after that I can create a pivot table without any problems.
AI: Assuming you are doing this once, rather than dealing with automatic processing of CSV files:
Reorder the columns by dragging, so that the comma-separated one is on the right (say, it's now column B)
Select the comma-separated column and choose "Data > Split text to columns" from the menu. That column will be split into several (two in your example: B and C)
Use the formula ={filter({B1:B, A1:A}, len(B1:B)); filter({C1:C, A1:A}, len(C1:C))} (possibly with more columns, if you have more of them after splitting). It produces a site-category array based on each of the columns obtained in step 2, and joins them. The filtering removes blank cells that are going to appear when some comma-separated strings have fewer elements than others.
The output is the two-column table of the form that you seek. |
H: Scammed on Facebook advertising, where to report? How to report that to Facebook?
Last day my girlfriend was scammed by a Facebook ad, the ad was on a boots shop which had a fake login page etc. So basically that scam site got my credit card number. The alarm to me was the fact the site was not allowing her to login (email not existing), then I checked and it was registered domain just few days ago, and there was no HTTPS at all, so I realized that is a scam and she will not receive any boots.
How can I report that to Facebook?
AI: From Facebook Help Centre:
How to Report Things
Ads
To report an ad:
Hover over the ad and click the X in the top right
Choose Hide ad to report a specific ad, or Hide all from... to hide all ads from that particular advertiser
Something I Can't See
If you can't report something on Facebook because you don't have a Facebook account or you can't see whatever you're trying to report, please use a computer to fill out this form.
In your case you can report the ad if you are still seeing that and fill out the form given in above link by selecting Other abuse option and give the complete details to them. Hopefully they will come back to you.
If you have received any email, you can forward it to phish@fb.com. |
H: Adding Second Row of Transposed Data ONLY After End of Data From First Row
In Google Sheets I am trying to use TRANSPOSE to list data from populated cells from Column range D-F directly after the Columns created by Transposing rows of data in range A-C.
Here is an image of what I'm trying to produce using fictional dataset:
Link to this sheet
I don't know how to get the Columns from the rows in the second range (D-F) to automatically display after the columns created by the data from the first range (A-C). Accomplishing this automatically, so that the Transposed regions will update dynamically with new columns when new rows of data are added to the original ranges, is the key.
Is this possible?
Do I need to use something like IMPORTRANGE or QUERY to accomplish this effect instead?
Any help would be appreciated!
AI: You can make this a single dynamic Function like this:
={TRANSPOSE(indirect("A3:C"&counta(B:B))),TRANSPOSE(indirect("D3:F"&counta(E1:E)+1))}
By using the indirect function - we are able to only make the range as long as there is data to transpose. |
H: How to regex extract alpha portion immediately after an underscore in Google Sheets?
Using Google sheets, here's what I'm trying to accomplish:
I have data that comes in like this:
xta_GAM-1a (61095)
xta_SM (61096)
xta_GAM2 (61156)
xta_GAM-1b (61161)
AO CPC ALL GAM
AO CPC ALL PA
AO CPC ALL SM
AO CPC ALL TPP
I want to extract only the first alpha portion after the underscore, or failing that just the last alpha portion, so resulting in this:
GAM
SM
GAM
GAM
GAM
PA
SM
TPP
How can I pull this off?
EDIT: @amit's answer got me most of the way there, and I figured out the last part on my own. Current solution is:
=if(iserror(search("_",C1)),REGEXEXTRACT(C1,".* (.*)$"),iferror(REGEXEXTRACT(REGEXREPLACE(C1,".*_", ""),"[A-Z]+"),""))
I will award to Amit unless anyone has something more compact, elegant, etc.
AI: This should work:
=REGEXEXTRACT(REGEXREPLACE(A1,".*_", ""),"[A-Z]+") |
H: How to copy specific columns to another sheet if value of cell changes in master sheet?
I want to create a logbook that keeps all historic data from my master sheet per row.
So what I am working on is:
If specific cell in mastersheet changes, copy the row corresponding with the changed cell to my logbook sheet. And in the process never delete existing rows in the logbook but only adding new rows to it.
function CopyDataToLogbook() {
var sss = SpreadsheetApp.openById('...'); //source spreadsheet
var ss = sss.getSheetByName('Recherche'); //source sheet
//Get full range of data
var SRange = ss.getDataRange();
//get A1 notation identifying the range
var A1Range = SRange.getA1Notation();
//get the data values in range
var SData = SRange.getValues();
var tss = SpreadsheetApp.openById('...'); // target spreadsheet
var ts = tss.getSheetByName('Logbook'); //target sheet
//set the target range to the values of the source data
ts.getRange(A1Range).setValues(SData);
}
This is what I have currently, which copies the exact data from Master to Destination. But this does not pay attention to 'only 3 or 4 specific columns to be copied not all columns.' and it does not pay attention to keeping existing rows in destination sheet. so it needs to look for the next empty row and add data from there on.
I am pretty new to this google app scripting. Any help would be nice.
AI: You should install a trigger to fire on edits and use its event object (denoted e above), for example as follows.
function CopyDataToLogbook(e) {
var sss = e.source; // edited spreadsheet
var sheet = e.range.getSheet(); // edited sheet
if (sheet.getName() == 'Recherche') { // check where the edit is
if (e.range.getColumn() >= 2 && e.range.getColumn() <= 5) { // check that the edit was to certain columns
var row = e.range.getRow(); // row where edit happened;
var values = sheet.getRange(row, 2, 1, 4).getValues(); // columns 2-5 in that row
var tss = SpreadsheetApp.openById('...'); // target spreadsheet
var ts = tss.getSheetByName('Logbook'); // log sheet
ts.appendRow(values[0]); // append row with our values
}
}
} |
H: Can a friend of a friend see my post?
I did not block the person I do not want to see my post. I want to know if a specific person, who I am NOT friends with,can see my post if a mutual friend likes it or comments on it. I have searched trouble shooting & Facebook FAQ's & my question is NOT answered.
AI: If your post privacy is set to:
Friends: then only and only your friends can see this post and comments on it
Only Me: visible to only you
Friends of Friends: It will be shown to all your friends and their friends too. Let's say you have 100 friends and each of your friend has 50 friend then your post will be seen by maximum 100 * 50 = 5000 buddies.
Public: public posts and comments on those posts can be seen by anyone on the web
Custom: You can list out the name of friends or lists, who can see this post. Even you can filter out friends and lists. |
H: Keyboard shortcut to close the ads on YouTube
I am wondering if there is any keyboard shortcut to close the ads (advertisement) on YouTube.
For example, as the one as in the picture below.
AI: The keyboard shortcut to skip the ad at the beginning of a video is Tab and then Enter.
There is no keyboard shortcut to skip ads in the middle of the video.
Other things to try
Install Greasemonkey (Firefox) or Tampermonkey (Chrome) either of which allows you to install userscripts in your browser.
Then, install the "Auto Close YouTube Ads" from Greasy Fork.
This approach doesn't block YouTube ads but instead makes them bearable. Site owners and content creators still receive revenue.
Get an Ad Blocker. For Chrome, I recommend uBlock Origin.
Note that this approach actually blocks the ads and denies income to the site owner and content creators. |
H: Returning the value in the bottom row of a column
I want to a cell to just print what the last cell in a column. If I were to have the column starting on row 17,
1
3
5
I want it to print five, but if I updated the list to
1
3
5
7
I want it to print 7, but I know nothing about the functions of spreadsheets.
AI: Formula
=INDEX(A17:A,COUNT(A17:A))
Explanation
Assuming that the data is on the column A, that it only has numbers, and that there are not blank cells between two cells with numbers, COUNT(A17:A) will return the count of cells having a number and it will be the index of the last cell with a number on column A. Index will return the value of the last cell that has a number in column A.
NOTES
If the values are TEXT instead of NUMBER use COUNTA instead of COUNT
If the values are mixed, TEXT and other type like NUMBER / DATE / TIME / DURATION , instead of the above formula use
=ARRAYFORMULA(INDEX(A17:A, MAX(IF(ISBLANK(A17:A),,ROW(A17:A)))))
or
=ARRAYFORMULA(INDEX(A17:A, MAX(IF(LEN(A17:A),ROW(A17:A),)))))
See also
Is there a constant to represent "last row of a column" in Google Spreadsheet? |
H: Converting binary into percentages
I'm using a binary system to determine whether someone showed up that date or not. 1 is "yes" 0 is "no". I am looking to turn this binary into a percentage:
100/5 = 20 * 3 = 60%
but I will need to add more dates in future and I don't want to keep having to calculate it by myself.
Is there a formula for this?
AI: It's better to have percentage on the left, next to the name. Otherwise, in a few months you will be scrolling way over to the right to see someone's percentage.
Use the average function, which takes the average of the values. And format the cell with this formula as a percentage, so that 0.6 is shown as 60%. (See Format > Number > Percent in the menu).
Example: =average(C2:2) is the average of all numbers in row 2, from column C to the last column (whatever it is). Put this in column B, copy it down, format as percentage and you won't need to change these formulas again. |
H: Boolean Operators in Google Custom Search
Given the search terms x,y,z, I want to construct a search query that returns
x AND (y OR z)
i.e. documents that do contain x and at least one of y and z (or both y and z). Now according to the documentation, I can use the following query
q=x&hq=y+OR+z
Now I am wondering if this returns what I want or rather
(x AND y) OR z
I found no way to test that. Any hint (also on how to test it) is very appreciated!
AI: Short answer
Instead of
q=x&hq=y+OR+z
try
q=y+OR+z&hq=x
Explanation
q It's required.
The search expression.
hq
Appends the specified query terms to the query, as if they were combined with a logical AND operator. |
H: Facebook Only Completes 1 Letter When I Type in Status or Messenger
This morning, I logged into Facebook and started communicating with some friends over Messenger when every sentence I typed and then hit enter, only 1 letter appeared in the Messenger window. I tried it in multiple windows but the same thing happened.
I also attempted to post a status in Facebook but the same thing happened, only 1 letter appeared.
To try and resolve this, I cleared cache/cookies, reset my browser to default and also rebooted but the issue persists. Has anyone seen this before?
AI: I changed my browser from Internet Explorer to Google Chrome. That's fixed it.
That's why it still worked on my phone as it uses Safari. |
H: Udemy: If a student is enrolled, does this mean he has already paid the course?
I have a question about the Udemy platform for video online courses.
I see that this course has been enrolled by more than 26.000 students and its cost is 200 dollars: https://www.udemy.com/devslopes-ios10/
Does this mean that all this students have paid the course, which means 5 million dollars?
AI: Does this mean that all this students have paid the course, which
means 5 million dollars?
Yes it means all the student paid for the course, but it doesn't mean 5 million dollar Udemy & the instructors runs a lot of discount time to time. The same course might be available as $10 some time. Mostly when a new course comes it would be lot less then $200 dollars. |
H: Sharing Google Spreadsheets Privately
If I share an interactive Google Spreadsheet using File > Publish to the web... does this spreadsheet include any personal information from my Google Account (eg. Full Name?)
If it does (somewhere in the docs.google.com hosted page's source code), is there a way to privately share this spreadsheet without this personal data?
AI: Short answer
Publishing to the web doesn't include private information other than the content of the file. The only one file property/meta-data that is shown in a published document is the file name.
Explanation
In the Google Docs editors argot, "publishing to the web" and "sharing" are two different and independent features. The related help articles are included in the references section.
Usually the Google Docs editors official documentation mention the included features, not the missing ones.
WARNING
While the published spreadsheet doesn't include any private information, this open other means of getting information of your spreadsheet but only to those that know the spreadsheet id.
The spreadsheet URL looks like this:
https://docs.google.com/spreadsheets/d/1tcLj7YF8Pp8P63oVzPGakHRV8v2dHPtTuH4icowp1jw/edit#gid=0
The spreadsheet id is 1tcLj7YF8Pp8P63oVzPGakHRV8v2dHPtTuH4icowp1jw
The URL of published to the web spreasheet looks like this:
https://docs.google.com/spreadsheets/d/e/2PACX-1vRjpwNxpLAj5BM7iaY7i1rnjOiivClHtAl8YNyuZGvpmh_ZAVrDG6UofS9fygH_WHzlkkbSw1TXPJGY/pubhtml
AFAIK there is no way to guess a spreadsheet id, so while you keep your spreadsheet private (not shared with anyone) your private information will be kept private.
References
Google Docs editors Help articles
Sharing files and folders
Publish a document, spreadsheet, presentation, or drawing |
H: How to sort rows by value in certain column
I have a Google Sheet of data that I would like to organize. There are multiple rows with values sorted by column. I would like to sort rows 3-19 based on the value in column B.
The algorithm I am using is this:
=SORT(3:19, B3:B19, FALSE)
And my error is:
Array result was not expanded because it would overwrite data in B2.
I have looked at this Google Support page but cannot get it to work properly.
AI: You are trying to sort the rows in place, with the output of sort overwriting the original rows. Spreadsheet formulas can't do that.
Instead, put the sort on another sheet. For example, if the original unsorted data is in Sheet1, the formula will be
=SORT(Sheet1!3:19, Sheet1!B3:B19, FALSE) |
H: Running time exceeded (Help with Token Usage)
I have looked through a number of the questions asked on this particular question however none of the solutions I have seen appear to apply to what I am working on.
I have a script which is attached to a spreadsheet, the goal is to run this script each night to generate a master file listing of all files in the drive and present them on a spreadsheet. Due to the number of files in folders, sub-folders, sub-sub-folders (you get the idea) it is unable to complete the update to the spreadsheet within the specified time frame.
function clear_spreadsheet() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
sheet.clear();
sheet.appendRow(['Name', 'Folder','Link', 'Last Updated']);
}
function listFolders(folder) {
folder = folder || DriveApp.getRootFolder();
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var file;
var name;
var urllink;
var row;
var currentfolder;
var lastupdated;
var files = folder.getFiles();
while ( files.hasNext() ) {
file = files.next();
name = file.getName();
urllink = file.getUrl();
currentfolder = file.getParents();
lastupdated = file.getLastUpdated();
sheet.appendRow( [name, folder, urllink, lastupdated]);
}
var subfolders = folder.getFolders();
while (subfolders.hasNext()) {
listFolders(subfolders.next());
}
};
function Run_Update(Folder) {
clear_spreadsheet();
listFolders();
}
Any thoughts as to how I can either streamline the code to run faster, or more likely find a way to generate a placeholder within the script and continue to run after a specified time frame until it comes to the end of its search?
EDIT: I've seen that you can utilize tokens and timers to facilitate this however its not something I am familiar with. Does anyone know the process for calling this type of function in this manner?
EDIT 2 See below for the final code which resolved the issue of exceeding the run time in this particular instance.
function Start_Up() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getActiveSheet();
sheet.clear();
sheet.appendRow(['Name', 'Folder', 'URL', 'Updated'])
var start_time = new Date();
MailApp.sendEmail({
to: 'add your email',
subject: "Master File Update - Complete",
htmlBody: "The update of the master equipment document spreadsheet was started at: " + start_time});
var Script_Properties = PropertiesService.getScriptProperties();
Script_Properties.deleteAllProperties();
Iterate_Files();
}
function Delete_Triggers() {
var Triggers = ScriptApp.getProjectTriggers();
for (var i = 0; i < Triggers.length; i++) {
ScriptApp.deleteTrigger(Triggers[i]);
}
}
function Iterate_Files() {
var Script_Properties = PropertiesService.getScriptProperties();
var continuationToken = Script_Properties.getProperty('C_Token');
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getActiveSheet();
Delete_Triggers();
var Start_Time = new Date().getTime();
var Seconds = 0;
if (continuationToken) {
var files = DriveApp.continueFileIterator(continuationToken);
} else {
var files = DriveApp.getFiles();
}
var output = [];
while (files.hasNext() && Seconds < 240) {
var file = files.next();
var Current_Time = new Date().getTime();
var Seconds = Math.floor((Current_Time - Start_Time)/1000);
var file_name = file.getName();
if (file.getParents().hasNext()) {
var folder_name = file.getParents().next().getName();
} else {
folder_name = 'Root';
}
var file_url = file.getUrl();
var file_last_updated = file.getLastUpdated();
output.push([file_name, folder_name , file_url, file_last_updated]);
}
if (output.length) {
var last_row = sheet.getLastRow();
sheet.getRange(last_row +1, 1, output.length, 4).setValues(output);
}
if (files.hasNext()) {
var triggerID = null;
continuationToken = files.getContinuationToken();
Script_Properties.setProperty('C_Token', continuationToken);
ScriptApp.newTrigger('Iterate_Files')
.timeBased()
.after(1 * 60 * 1000)
.create();
} else {
Script_Properties.deleteAllProperties();
var end_time = new Date();
MailApp.sendEmail({
to: 'add your email',
subject: "Master File Update - Complete",
htmlBody: "The update of the master equipment document spreadsheet was completed at: " + end_time});
ScriptApp.newTrigger('Start_Up')
.timeBased()
.everyDays(1)
.atHour(0)
.create();
}
}
AI: You may be able to improve the performance by replacing individual row insertions in a loop by a batch operation post-loop (as Google themselves recommend):
var output = [];
while (files.hasNext() ) {
file = files.next();
name = file.getName();
urllink = file.getUrl();
currentfolder = file.getParents();
lastupdated = file.getLastUpdated();
output.push([name, folder, urllink, lastupdated]);
}
if (output.length) {
var lastRow = sheet.getRange.getLastRow();
sheet.getRange(lastRow + 1, 1, output.length, 4).setValues(output);
}
Apart from that, you could try to split the task into smaller one: for example, "process the folders where the first character of the name is in the range A-E". Then set separate triggers for such functions, for different times. However, the algorithm gets a bit complicated since one should go through the subfolders under a folder that itself isn't a part of the currently processed range.
As a last resort, there's a way stop/resume the execution of a script, see this answer. You can try storing folder Id in script properties and resuming with that folder. But this also gets complicated because of the nested structure: there are file/folder iterators that you can't simply store and renew. |
H: Match strings with more than one character in Google Sheets
I have the following query:
=QUERY('Data'!A2:F,"SELECT A, B, F WHERE C=''")
In column E I also have strings which correspond to last names. I want to select all rows where the string in E has more than one char.
I've tried using the MATCH and LIKE operators but haven't managed to get it to work. One solution I actively avoided was using an extra column with the LEN function and select based on the values there. I would like the logic to be contained in the query as much as possible.
AI: So you can use the like operator with query like this:
=QUERY(Data!A2:F,"SELECT A, B, F WHERE C='' and E like '__%'")
basically _ means any one character, and % means 0 or more characters - so by using 2 instances of _ before using % it requires there be at least more than one characters, while also allowing it the flexibility of using a wildcard. |
H: Will view-only users see my email/username?
If I create a Google Doc and set it to view only, will other users(logged in or not logged in) be able to see my profile pic or my email/username?
If they can see one of these things, is there a way to hide it?
AI: Short answer
Google document view only users could see your Google profile name and picture on:
the list of files on Google Drive / Google documents app showing you as the file owner
on the Google Documents editor when you open the file at the same time as the viewer
There is no way to hide this information but you could set the name and picture that you wants, even to keep the default picture. At this time instead of person silhouette, the first name initial is shown. The alternative is to publish to the web instead of sharing.
Explanation
Publishing to the web
See this answer to Sharing Google Spreadsheets Privately
Official documentation extracts
From Edit your Google Account information
What Google does with this information
Google uses this information to help other users of Google products (like Hangouts, Gmail, and
Maps) learn more about you and easily get in touch. For example, when
you're having a conversation with someone on the Gmail or Hangouts
app, they can click or touch your display photo, which shows the
contact details you've decided to share.
Learn how to control how others see your information across Google.
From Control what others see about you across Google services
Preview what your information looks like to others
You can use the "Preview" feature to see how your information might appear to others
who have permission to see it.
Preview how your information shows up
Sign in to About me.
On the top left, select the Menu Menu and then Preview. A panel will appear with your information organized in cards.
To close this view, click or tap outside the panel.
Other users who are looking at your information in an app might see
different content than what's shown here. What they see depends on a
few things, including:
What information you've shared with who
What selection of information the app displays about you |
H: How can I restrict a Google Scholar search to a specified set of journals?
As an example, suppose I want to search for articles that contain the words "class size" and appear in either The Journal of Political Economy or in the American Economic Review. When I use the advanced search, it works as expected when I search for "class size" and restrict it to The Journal of Political Economy
or to American Economic Review individually. However, when I try to restrict the search to the union by separating with an OR or with a comma, it doesn't work. It thinks I'm looking for a journal called The Journal of Political Economy OR American Economic Review, for example. Does anybody know if this is possible to do, and if so, what the correct syntax is?
EDIT: So, for the case mentioned above, it seems to work just fine if I put quotes around each journal name:
"Journal of Political Economy " OR "American Economic Review"
I can do this in the advances search bar, or in the main bar at the top with the syntax mentioned in the answer below:
class size ("Journal of Political Economy " OR "American Economic Review")
However, what I didn't realize is that the problem that I was originally running into was also that the search bar seems to be cutting off the end of the search query if it's too long. For example, suppose I search among three different journals:
class size ("Journal of Political Economy " OR "American Economic Review" OR "Quarterly Journal of Economics ")
I get the following result:
Am I doing something wrong here, is this a bug, or does Google Scholar simply not support doing things like this? Ideally, I'd like to limit a Google Scholar search to 5-10 journals rather than be limited to just two. Any ideas?
AI: Try the advanced search
or write in the search box
"class size" ("The Journal of Political Economy" OR "The American Economic Review") |
H: What's the workflow to bulk delete e-mails from within Gmail?
I'm getting the out-of-storage space error for Gmail:
How does Gmail's "out of storage space" work?
Since I'm obviously doing it wrong, what's the correct way to delete all e-mails within a label without creating a filter or deleting the label itself?
AI: Search for the messages you want to delete
example: label:mylabel
Click the checkbox at the top to select all of the conversations on the page
You'll get a message similar to:
All 100 conversations on this page are selected. Select all 75432 conversations
The latter portion is a clickable link. Click it.
Now all your messages matching the search are "checked"
Click "Delete"
It may take a few minutes to move them all to Trash.
If you get an error, you're probably simply trying to do too many at once for your local browser, network, and/or server to handle. (It shouldn't happen, but apparently it does for you.) Try breaking your search up into smaller, but manageable, chunks. There are several advanced search operators you can use. You might try one of the time-based operators, so you can do something like this:
Search for all the messages with your label that are older than a year:
label:mylabel older_than:1y
Then follow the other steps above. |
H: Create a list of categories from a 2D array
I have data like the following:
CategoryA SubA1 SubA2
CategoryB
CategoryC SubC1
...
I would like to avoid using scripts and hopefully only use one (albeit complex) formula to get an array like the following:
{"CategoryA", "CateogryA-SubA1", "CategoryA-SubA2", "CategoryB", "CategoryC", "CategoryC-SubC1", ...}
So far I have been able to get various pieces of this, but I don't know how to combine it all together. For example I can get {"CategoryA-SubA1", "CategoryA-SubA2"} with ARRAYFORMULA(CONCAT(CONCAT(A1, "-"), FILTER(B1:1, NOT(B1:1 = "")))). I have also gotten this:
CategoryA-
CategoryB-
CategoryC-
using ARRAYFORMULA(CONCAT(FILTER(A1:A, NOT(A1:A="")), "-")).
The difficulty seems to come from dealing with a 2D array. I want to do a particular operation to each row, which involves doing a particular operation to each column in that row.
AI: I think any formula will be limited by the number of columns or rows that it can handle. Here is one for 4 columns, A-D:
=iferror({filter(A1:A,len(A1:A)); filter(A1:A&"-"&B1:B, len(B1:B)); filter(A1:A&"-"&C1:C, len(C1:C)); filter(A1:A&"-"&D1:D, len(D1:D))})
It removes empty cells from each column, and prepends the content of A to the columns other than A. The iferror wrapper suppresses #N/A, which are returned when a filter has empty output. The output is a column; if you prefer a row, use transpose, and if you want a single-cell output, use join. |
H: Google Sheets Search and Display Location
I have a table like so:
+---+-----+
| A | 100 |
+---+-----+
| B | 125 |
+---+-----+
| C | 454 |
+---+-----+
| A | 234 |
+---+-----+
| A | 343 |
+---+-----+
| B | 222 |
+---+-----+
| C | 754 |
+---+-----+
I want to write a query where I can search for a particular letter under column A and then display the corresponding value and cell location. I wrote a query like this:
=QUERY(A1:B20, "SELECT B WHERE A='B'")
That generates the following results:
+-----+
| 125 |
+-----+
| 222 |
+-----+
But what I want it to display is:
+----+-----+
| A2 | 125 |
+----+-----+
| A6 | 222 |
+----+-----+
Where it shows the location of all the numbers associated with B. How do I change my formula to display cell locations?
Additionally: it would be nice if I can hyperlink the cell locations to jump directly to the spot. Is there a way to dynamically hyperlink the resultant table?
AI: You can create another column on the fly and select it with the query:
=query(arrayformula({A:B, "A"&row(A:A)}), "select Col3, Col2 where Col1 = 'B'")
The arrayformula prepares a three-column table, with the third column being cell references. Since this is a table not contained in the sheet, the column references are abstract names Col1, Col2, Col3 instead of letters A,B,...
There are no hyperlinks leading to cell locations in Google Sheets. |
H: Signing into Chrome with a work email on personal computer on personal network
I left myself signed in to my work Gmail account on my personal computer. This occurred at home on my own personal network. I also use my work email address as my sign in for Chrome. I had an internet session that was not suitable for work. At all. This included Google searches and YouTube searches.
Will my employer be able to identify what I have been searching?
AI: If you logged into your Gmail account from your home network they can't see your browsing history. Just don't browse NSFW things in the company's network or while you're connected to the company's VPN.
You can go to myactivity.google.com and delete your activity (just in case someone will access your account if you leave it open or other cases). |
H: How to specify a character range on Google Sheets conditional formatting
I'm trying to color cells that do not start with a letter; but I'm not sure how to specify a character range in this format.
Cells contents such as:
!this one <--- formatted
this is fine
@email.com <--- formatted
leading space <--- formatted
Ideally, it would color the cell for any non-letter.
AI: Formula
=REGEXMATCH(A1,"^[^a-zA-Z]")
Explanation
Set conditional formatting to use a custom formula.
Apply the above formula.
The first ^ means start of the string
Note that the second ^ is inside of [], this means a logical NOT.
The a-zA-Z are a two character ranges, lowercase letters and uppercase letters.
References
REGEXMATCH (Google Docs editors Help)
Getting started with Regular Expressions (Documentation - Stack Overflow ) |
H: MotoGP 2017 events to Google Calendar
The 2017 Calendar of MotoGP™ is published on the web. Is there any way to import MotoGP 2017 events to my Google Calendar?
AI: Yes, such a calendar (displayed as a table on a webpage) can be imported in Google Calendar, though not without a little headache. My strategy is to use importhtml to import it in a spreadsheet, then save as CSV file, and import it into calendar.
Step 1: Make sure the Locale setting of your Google spreadsheet is consistent with the date format used on the webpage you are importing. For example, I normally have United States as the locale (with date format mm/dd) but the MotoGP calendar uses dd/mm, so I changed my locale to Germany for this experiment.
Step 2: import the calendar with
=importthml("http://www.motogp.com/en/news/2016/12/07/2017-motogp-calendar-updated/211047"; "table"; 1)
Let's say this formula is in A1 of Sheet1. The semicolons are used as separators because of European locale. The dates should be recognized as dates except since they don't have a year, the year will be assumed to be the current one. If you are doing this in 2016 for 2017 calendar... this will be need to be fixed on the next step.
Step 3: Create another sheet, with the top row headers "Subject" and "Start Date" as Google instructs. Under the first header, put ={Sheet1!C2:C19} to get the event names. Under the second, put =arrayformula(text(Sheet1!B2:B19+365; "yyyy-mm-dd")) which adds 365 to each event date*, moving it from 2016 to 2017, and then formats it in the internationally accepted way.
Step 4: Save the sheet with these two columns as a CSV file. Then follow the instructions om importing events: "Settings > Calendars > Import Calendar".
(*) Why 365, when 2016 is a leap year? Because all of the events happen in March or later... bullet dodged. Dates are fun. |
H: Translating an Excel ConcatIf argument to Google's CONCAT formula
I have an inventory spreadsheet created in really old Excel (2000!) with two pages; Inventory and Master. Everything looks fine in Google Sheets, until it comes to the ConcatIf argument on my Master page. The second page calls for words from the first page, using a fairly simple concatenation argument. Here is the formula for the first row on the Master page:
=ConcatIf(Inventory!A:A,"*"&Master!A4&"*",Inventory!B:B,", ")
It is matching the name on line 4 in Master with the name in Inventory on column A, then drawing out the words related to that name, found in column B of Inventory, and returning them as a list.
When I look at this spreadsheet in Google Sheets, the results on the Master page fail. It says I'm using four arguments, when only two are expected.
How can that formula be translated to CONCAT? I'm not a master of this language, the formula was written for me by one.
Some clarification:
This is about a spreadsheet for people and the names of photographs related to them.
Inventory page has column A with various person's names, and column B with the names of images they appear in. Personal names are frequently repeated.
Master has column A with all personal names in alphabetical order, and column B seeks to concatenate all the image names relevant to the person named in A. For every name in Master A, there will be corresponding instances in Inventory A. I'm just trying to gather all the image names from Inventory B to Master B.
So concatenate still seems like the answer to me. It's only a question of translating it from Excel to Google.
Here is a link to an example spreadsheet created in Google, using the formula suggested by zaq. https://docs.google.com/spreadsheets/d/1kfxHnm5nHHrwLBCFCGLxoyuBqEFKj1l_AqCzIcVFYew/edit?usp=sharing
AI: This is more dynamic if you also use regex instead of wildcards as the specific way in which you're using the wildcard is different in Google Sheets compared to Excel .... but this works:
=join(", ", filter(Inventory!B:B, istext(regexextract(Inventory!A:A,Master!A2))))
Note: you should also finally wrap your whole function with =iferror() so that you don't have to see that ugly #N/A when there are no matches... secondly, occasionally I convert everything to lowercase inside of the matching portion of the formula so as to avoid any one of many complications that can happen when you user generated content or input.
That would end up looking like this:
=iferror(join(", ", filter(Inventory!B:B, istext(regexextract(arrayformula(lower(Inventory!A:A)),lower(Master!A2)))))) |
H: How to disable "Trending on Google+" posts?
Is there a way to disable the "Trending on Google+" post from appearing on my feed?
The only help I could find is https://support.google.com/plus/answer/1686118?hl=en and is for the old ("classic") Google+.
AI: On https://plus.google.com/settings, look for the following setting in the "stream" section.
Amount of Trending & Recommended posts to show in stream |
H: Direct link to Gmail Compose in full screen mode
I want to bookmark direct link to GMail compose page in full screen mode. The current link I found https://mail.google.com/mail/u/0/#inbox?compose=new opens it but I have to press full screen button manually.
Anyway to get it directly?
AI: Make sure to select the option Default to full screen from your new mail window, like in the picture below. |
H: Share Calendar with two Google accounts
I have two Google accounts, say Account1 and Account2. I use and maintain a single calendar from Account1. Each time I'm in Account2 and need to add a calendar event, I log out of Account2 then into Account1 and finally add the event to the calendar.
Is there a better way? One option would be to maintain separate calendars for each account but more interesting would be to set Account2 to use (and be able to view, edit, etc) the calendar from Account1...I'd be fine with disabling the calendar for Account2.
AI: You can share your main calendar from Account1 with Account2.
Just go to the settings (gear, upper right) in Account1, choose Calendars and enter "Share this calendar" right of your main-calendar. Then you can enter the e-mail address of Account2 and choose "Make changes and Manage sharing" and you'll get a notification-mail in Account2 to add that calendar. Now you can manage the complete calendar for Account1 while being logged-in as Account2.
Please note that when adding events, your main calendar of Account2 is checked by default. If you only want Account1s calendar visible you can press the pull-down next to Account1-calendar and choose "Display only this calendar". Any new events will be for Account1 as default. |
H: How to hide Facebook register/login message?
I don't have a Facebook account and I don't want any.
The problem is many companies use their public Facebook pages as their websites these days, especially pubs, small shops etc.
When I enter their Facebook pages, this extremely annoying message appears:
I click "Not now", which makes this message a little smaller, but it still covers about 20% of the page. I hate it.
How can I get rid of this once for all?
AI: You can delete the tag that create this frame by Inspect Element.
Press F12 or click on the right button of your mouse and select Inspect Element.
Click on the left top icon:
Select the frame to delete:
Press the delete key.
Be happy. |
H: How does Gmail's Un-send feature work?
Google's Gmail has the feature that allows you to Un-send an email within a few seconds after hitting send. I can of course guess on how this works but I've never been able to find any specific details on how this might be accomplished.
My theory
Basically I imagine the way this works is that Google is able to track the state or status of an email coming into their servers and/or being delivered to the recipient. An email sent through Gmail would initially be in some kind of "uploading" state and the Gmail browser client would continually read the state of the email until it changes to "unretrievable" at which point the message changes to "Sent" and the undo option disappears.
My main question around this is how do they prevent race conditions?
For example what if I click on the Un-send button milliseconds before the status changes to unretrievable and my Un-send packet doesn't reach the server fast enough.
What kind of reversal process would occur?
How does Gmail's Un-send feature work and specifically how do they prevent race conditions?
AI: Quite simple. It quite literally does not send the mail until the time is up. And if you're too slow, too bad, the mail's been sent to the other server.
I don't think they'd bother with absolute last minute regrets, and people dramatically reaching for the undo button at the last moment, while it makes for good excessive drama, isn't really a concern.
There's no 'takie backies' in email. |
H: What does "Auth to Services" option mean in IRC?
The https://webchat.freenode.net/ IRC client
has an "auth to services" option. A quick google search does not reveal what this means.
What does this option do, and when should I use it?
AI: The "Auth to Services" option lets you log in when you have registered with Freenode's NickServ, which reserves your nickname and provides other privileges.
This SuperUser post has a guide for signing up with NickServ with webchat if you haven't done so before. |
H: PDF shows only top row of spreadsheet
I am attempting to export a spreadsheet which is "created" daily through an automated e-mail in Google Apps Script. When attempting to convert to PDF I only get the top row shown in the PDF document (none of the data).
var file = DriveApp.getFileById(spreadsheet.getId()).getAs(MimeType.PDF);
MailApp.sendEmail('email', 'Equipment Update', 'Spreadsheet Attached', {
name: 'Testing',
attachments: [file]
});
I have checked and the spreadsheet does have the appropriate list of information on the sheet which is to be exported.
Any ideas as to what might be causing this?
AI: It appears you were trying to convert a spreadsheet to PDF immediately after it was filled with data. This is sometimes an issue because the data may be stuck in a pipeline: the changes are not immediately applied for performance reasons. Use the command
SpreadsheetApp.flush();
before conversion to PDF, to make sure any pending changes are applied. Reference. |
H: How can I access an article directly from its Google AMP page?
How can I access the actual article page from a Google AMP results page?
I did a Google search for "Lego Investment Telegraph", the first result was an AMP page (screenshot). After loading the AMP page, I could not find a link to load the actual article. Without editing the URL manually, is there any way to access an AMP article without AMP?
AI: The link to full article is present in the markup of the page but is typically not shown. The following bookmarklet extracts it and directs the browser there.
javascript:window.location=document.querySelector("link[rel=canonical]").href
To put the bookmarklet in the mobile browser, create a bookmark to whatever page, and then replace the URL with the above (preferably, copy-pasted from this site rather than retyped). If you name the bookmarklet "full", it should be possible to invoke it by typing "full" (or even "fu") in the address bar while you are on an AMP page, and picking the bookmarket from the dropdown with suggestions.
(Bookmarklet written by Shog9.) |
H: Duplicate multiple Google Calendar events, changing their dates/times
My Google Calendar has several (50 or more) events that happened in Spring 2016. They are individual events, not a single repeated event. I will be running very similar events in Spring 2017: same number of weeks, same days of weeks, same titles of events. (One example of such situation is the schedule of classes).
How to batch-copy the existing 2016 events so that they work for me in 2017?
AI: This can be done with the Apps Script shown below. The calendar Id is found on the Settings page of a calendar. The startPeriod and endPeriod indicate the range in which the original events take place (2016-01-01 to 2016-06-01 in my example).
The adjustment of dates is separated into a separate function, tweak. I also adjusted start/end time of the events that are not all-day events; these lines are commented below.
function batchCopy() {
var id = '...@group.calendar.google.com'; // enter Calendar Id
var cal = CalendarApp.getCalendarById(id);
var startPeriod = new Date('2016-01-01T00:00:00.000Z');
var endPeriod = new Date('2016-06-01T00:00:00.000Z');
var events = cal.getEvents(startPeriod, endPeriod);
for (var i = 0; i < events.length; i++) {
var event = events[i];
var title = event.getTitle();
if (event.isAllDayEvent()) {
cal.createAllDayEvent(title, tweak(event.getAllDayStartDate()));
}
else {
var start = tweak(event.getStartTime());
start.setHours(9, 30, 0, 0); // new starting time, 9:30
var finish = new Date(start);
finish.setHours(10, 25, 0, 0); // new ending time, 10:25
cal.createEvent(title, start, finish);
}
Utilities.sleep(1000);
}
}
Next, the function tweak which receives the old date of the event and returns the new date. If the goal was to have the same date in another year, then the first two lines of this function would be enough. But I wanted to have the same days of week. Normally, a year has 52 weeks and 1 more day, so one should subtract 1 from the date to have the same day of week. This is done by the line
tweaked.setDate(date.getDate() - 1); // normal offset
But the dates in January-February of 2016 have to be offset by 2 because 2016 was a leap year while 2017 isn't. Hence the if statement below.
function tweak(date) {
var tweaked = new Date(date.getTime());
tweaked.setYear(2017); // changed the year
// the rest is to offset the date to have the same day of week
if (tweaked.getMonth() < 2) {
tweaked.setDate(date.getDate() - 2); // leap year offset
}
else {
tweaked.setDate(date.getDate() - 1); // normal offset
}
return tweaked;
}
The above is all that one need to batch-copy events. But if a mistake happens, there should also be a way to delete the incorrectly created events. This is what the function below is for: it deletes all events between startClearPeriod and endClearPeriod - in my example, 2017-01-01 to 2017-06-01.
function deleteEvents() {
var id = '...@group.calendar.google.com';
var cal = CalendarApp.getCalendarById(id);
var startClearPeriod = new Date('2017-01-01T00:00:00.000Z');
var endClearPeriod = new Date('2017-06-01T00:00:00.000Z');
var events = cal.getEvents(startClearPeriod, ClearPeriod);
for (var i = 0; i < events.length; i++) {
events[i].deleteEvent();
Utilities.sleep(1000);
}
}
The Utilities.sleep calls are inserted because CalendarApp does not like creating or deleting many events (50+) without any pause in between. |
H: How to set a default `kind` and `priority` when creating a ticket in Bitbucket?
When a new issue is created in bitbucket the default kind and priority are bug and major respectively.
How to change these?
AI: I don't think they have anything like that. I was also looking for the same some time back but found this.
https://bitbucket.org/site/master/issues/2930/custom-issue-priorities.
As per current status it says
We don't have custom issue priorities on the short term roadmap at the current time.
and status is
on hold |
H: Can I send a message to the owner of a YouTube channel with nothing on it?
A YouTube user has placed a comment on a video and I wish to message them without everyone knowing of the conversation as I'll be using my personal story to convey a point in relation to his query.
It's not my channel that he has commented or nor is it his.
When I click on his name it's all pretty bare.
Is there a way I can contact him?
AI: It sounds like you are asking how to send a PM (private message which only you and the recipient can see) on YouTube.
To send a PM to another YouTube user:
Create a YouTube/Google+ account if you do not already have one.
While exploring YouTube, click on the user you want to message. This
will momentarily cause more info about the user to hover above
the username but don't click again, just wait and you will be
directed to the user's channel page.
Depending on that user's privacy settings, you may see the following links across the bottom of the Channel header:
Home Videos Playlists Channels Discussion About
Click About
Click Send Message
Enter your message and click Send
If the user you are trying to send the message to does not have a "confirmed" account, this feature will not be available in their channel. Your only alternative will be to arrange, initially via public comment, to communicate over another means. Keep in mind also, if their comment is rather old (a few years at least), they may have posted that comment before Google+ was melded with YouTube, in which case if they have not Created a Google+ account, they may be unable to even make new public YouTube comments. If their comments are more recent, you can obviously rule that out though.
Here is the official help page from Google Support. |
H: Lookup both horizontally and vertically to match column headers with row headers
I have a sheet like this:
Date|101|102|103|104|
---------------------
1/1 | A | | | |
1/2 | | A | | |
1/3 | | | | |
1/4 | | | | A |
1/5 | | | A | |
Then on a second sheet, I would like to fill in the following question marks:
ID | DateA
-----------
101 | ?
102 | ?
103 | ?
I can identify the column on sheet 1 for each ID on sheet 2 using
=match(A2,Sheet1!1:1,FALSE)
But I haven't been able to figure out how to then feed this into a second match a la
=match("A",Sheet1!?results from above would go here to select the right column?,FALSE)
I have been looking at the indirect functions and address functions but it is not clear to me that they will do what I need.
AI: Assuming the Date column of Sheet1 is column A, and the table with "A" letters is in columns B-Z, the following performs the lookup:
=filter(Sheet1!A$2:A, filter(Sheet5!B$2:Z, Sheet5!B$1:Z$1 = A2) = "A")
The idea is that the inner filter picks the column where the ID number of interest (in A2 of the current sheet) is in the top row. The outer filter then picks the date from column A that corresponds to letter "A" in the table.
The above assumes you have one match for each ID. If there happen to be multiple dates, there are two options:
wrap the formula in =transpose(...), so that the results will appear as a row of dates
wrap the formula in =array_constrain(...), so that only the first match will appear. |
H: Timestamp Google Drive's "last modified"
I'm trying to get a cell in my Google sheet to reference the last modified timestamp from the Google Drive of the same file (not folder).
In other words, I'd like for a cell to update its timestamp for an entire Google sheet, whenever a change is made. It should reference every sheet within the file itself.
AI: Short answer
IMHO the easiest way is to add =NOW() as a cell formula.
Explanation
The Google Sheets spreadsheet recalculation settings default value is "On change", that means that the result of NOW will be updated everytime a change is made on your spreadsheet.
References
Set a spreadsheet’s location and calculation settings
NOW |
H: How can I send an HTML e-mail with new Outlook.com web access?
I have a piece of HTML which I want to send as an e-mail. In previous versions Outlook.com had an option to "edit HTML" but I am not finding anything similar in the latest version. How can I do that now?
AI: The easiest way to add HTML to an email for a browser-based email client is to copy and paste it. But the catch is, you can't copy and paste the actual HTML markup -- you have to capture the results of the HTML.
This article has a good detailed breakdown of how to copy and paste HTML code into an email. (Note that for step #1, you don't need an actual HTML editor; you can use any text editor, like Notepad.)
EDIT: This method works with mixed results in the Outlook.com email editor. For example, copying and pasting the Stack Overflow toolbar renders outside the body of the email:
but other HTML snippets will render inside the body, like this Stack Overflow content:
However, both examples were able to be sent, and the HTML rendered correctly in the received email (and was functional -- links could be opened). |
H: How can I override my current sharing rules on Facebook for just the current post?
On Facebook I have my post sharing rules set to "Friends; Except [Group]" by default. However, on occasion I want to post something to just "[Group]" or I want to include them (i.e. post to "Friends").
However, if I change the audience of the current post Facebook remembers this and assumes that it's what I want for all subsequent posts, so I have to remember to change it back before posting again.
Is there a way I can just change the audience for the current post only?
AI: As of now there is no official way to change the audience for the current post only. You have to change it everytime, otherwise it will use last selected audience by default.
From Facebook Help Centre:
You'll find an audience selector tool most places you share status updates, photos and other things you post. The tool remembers the audience you shared with the last time you posted something and uses the same audience when you share again unless you change it. |
H: Copy card to top of new column by default, rather than bottom
Is it possible when copying / duplicating a card in Trello to set the card to go to the top of the column you are copying / duplicating it to?
AI: Yes!
When you copy a card you should see the "Copy to..." options appear that allow you to select the Board, List and Position you want the copy to go to. Just click each button to change the default selections.
Position means 1 is top of the list. Default position is usually LAST on the list, however many cards there are in that list.
If you want to put the copied card into the top 9 entries in the list, tap that number (1 - 9) after clicking on the position button. (tapping 1 will put the card first in the list) |
H: Usage of GetValues
When searching for values in a table I am currently running a check on specific cells with the following code:
for (var i = 11; i < (lastrow+1); i++) {
var equip = sheet.getRange(i, 33).getValue();
var equip_name = sheet.getRange(i, 34).getValue();
var mech_date = sheet.getRange(i, 39).getValue();
var elec_date = sheet.getRange(i, 42).getValue();
if (mech_date && elec_date == '') {
output_mech_only.push([equip, equip_name, mech_date]);
} else {
if (mech_date == '' && elec_date) {
output_elec_only.push([equip, equip_name, elec_date]);
} else {
if (mech_date && elec_date) {
output_mech_elec.push([equip, equip_name, mech_date, elec_date]);
}
}
}
}
As it stands the code above works just fine, and serves its purpose. However in the interest of simplifying things I have been looking into how to use .getValues() instead to streamline the code. I have looked through the documentation and am unclear as to how I would reference the needed columns.
Is anyone able to clarify the usage of .getValues() in this particular instance?
AI: This is how it could look like with getValues:
Each call to getRange(...).getValues() gets a double array of values in the rectangular block determined by the arguments of getRange: top row, leftmost column, number of rows, number of columns.
When accessing individual values, use two indices [i][j] keeping in mind that they begin with 0s. That is, array[0][0] will be the value in the upper left corner of the range.
Since two of the columns were consecutive, they are grabbed together into equip_array; the other two are grabbed separately. It would also be reasonable to get all of the columns at once, in an array spanning 10 columns from 33th to 42nd. But I think the code is easier to maintain (in case of spreadsheet structure changes) if non-consecutive columns are dealt with separately.
var equip_array = sheet.getRange(11, 33, lastRow - 10, 2).getValues();
var mech_date_array = sheet.getRange(11, 39, lastRow - 10, 1).getValues();
var elec_date_array = sheet.getRange(11, 42, lastRow - 10, 1).getValues();
for (i = 0; i < equip_array.length; i++) {
var equip = equip_array[i][0];
var equip_name = equip_array[i][1];
var mech_date = mech_date_array[i][0];
var elec_date = elec_date_array[i][0];
// the rest as in your code |
H: How to increase precision of labels in Google Spreadsheets chart?
I created a chart in my Google Spreadsheets. For the sake of example let's say that horizontal labels are months of the year, for example 01.2016, 02.2016, 03.2016 etc. and vertical labels are amount of money that I earned and spent.
But as you can see on this screenshot, the chart will not show me labels with every month, only 01.2016, 03.2016 etc. There is no 02.2016 for example.
How to make it to show every label, for every month?
AI: When dates are treated as dates, Google Sheets picks the spacing of tickmarks automatically. These need not coincide with the dates you have, and cannot be adjusted.
But you can select "Treat labels as text" on the "Customizations" tab of chart creation dialog. This will result in every entry from column A showing up as a label on the chart, which is what you want.
NB: "Treat labels as text" is only appropriate for time series when the time points are uniformly spaced (as in your example), since it gives equal horizontal spacing to each row. |
H: Average time on group by using Google sheet query language
I am trying to do a group by operation on the following table using the query language of Google sheet.
Type Value Duration
A 50 00:50:00
B 5 00:06:00
A 50 00:45:00
C 15 00:30:00
B 5 00:03:00
C 15 00:25:00
I am grouping by the column Type and I want the sum of Value and the average of Duration. I can do the sum of Value by:
=QUERY(A2:C7; "SELECT A, SUM(B) GROUP BY A")
But when I try to average time using, for example:
=QUERY(A2:C7; "SELECT A, SUM(B), AVG(C) GROUP BY A")
It throws the following error:
Error
It was not possible to analyse the string for the Function QUERY parameter 2:
AVG_SUM_ONLY_NUMERIC
AI: Indeed, out of the six data types supported by query (string, number, boolean, date, datetime, and timeofday), the avg function can be used only on numbers. So you have to convert duration to number (the function N does this) and average that:
=query({A2:C7, arrayformula(N(C2:C7))}, "select Col1, sum(Col2), avg(Col4) group by Col1")
Here the array constructed by {A2:C7, arrayformula(N(C2:C7))} has four columns, the fourth one being the datetime converted to numbers. This is the column which gets averaged. You will need to format the column into which the average is returned as duration. |
H: How to get data from other sheet from the rows with Id matching the master sheet?
here is the sample of my sheet:
https://docs.google.com/spreadsheets/d/1gr2QHtDCBHiOXUAiQ1ZVEmDKq5CGIGkLGpRM2tZhPBs/edit?usp=sharing
"Data1" & "Data2" is for input the data
"Master" is for overview all of the data by input the ID and add a mark.
"Output1" & 2" is same as "Data1 & 2" but only show the items with mark in "Master"
Should I use vlookup or index and match?
AI: I suggest vlookup in combination with filter. Here is an example:
=arrayformula(vlookup(filter(Master!D2:D, Master!E2:E="o"), {Data1!B:B, Data1!A:E}, {2,3,4,5,6}, false))
Step by step:
filter(Master!D2:D, Master!E2:E="o") takes the Id s from Master column D where column E is marked "o".
{Data1!B:B, Data1!A:E} prepares an array for lookup. This is only needed because your Id is not in the first column of the range; so an array has to be created with Id in the first column.
vlookup searches for the Ids returned by filter and returns the corresponding columns A-E from Data1
arrayformula ensures this all happens at once, no need to paste the formula row by row. |
H: What can cause a message to be moved to Trash in Gmail?
I regularly receive promotional emails from Pizza Hut in Israel. I only ever notice them, though, because they cause my phone to buzz and if I look quickly enough I see the message. Within seconds, though, the message is always moved to my "Trash" folder. I don't have any custom filters that send messages to trash (in the "Filters and Blocked Addresses" tab of the settings menu), so I don't think that could be it.
I initially suspected that the all-Hebrew messages were causing the spam filter to filter those messages out, but again, they're in "Trash" not "Spam".
The beginning of this happening may have corresponded with my switching to Google Inbox from classic Gmail, but I'm not sure about this. What could be causing this to happen?
AI: Gmail will only move messages to Trash automatically if you have a filter set up. (Blocked addresses go to Spam.)
More than likely you have given access to your Gmail account to some third-party application. (There are any number of apps which profess to help you organize your email.) Check that you haven't forgotten about one of them. (See: How can I figure out which apps have access to my Gmail?) |
H: How do I autofill a formula referring to a column into a row on Google Sheets?
I made a Spreadsheet to link with a form, but the form responses are added automatically with a horizontal header on the top. I want a vertical header on the left, so I created another sheet and used the formula ='Form Responses 1'!## to copy data from the form responses sheet to the new sheet. But when I try to autofill each row, it doesn't follow the order I want. I need it to fill like this:
='Form Responses 1'!A2 | ='Form Responses 1'!A3 | ='Form Responses 1'!A4
But it fills like this instead:
='Form Responses 1'!A2 | ='Form Responses 1'!B2 | ='Form Responses 1'!C2
What can I do to autofill my formula correctly across 30+ columns on each of my 7 rows?
AI: It looks like you want to transpose columns into rows. This is what the transpose formula is for. In cell A1 of the second sheet, enter
=transpose('Form Responses 1'!A:Z) |
H: Highlight minimum value in each row, ignoring zeros and skipping columns
I'm trying to highlight the smallest value in each row using conditional formatting (CF), while ignoring zeros and blanks. Also, I don't want the ranges to be continuous (i.e. skipping certain columns).
For example, give the following sheet:
A B C D E
1 345 0 skip 123 <empty>
2 0 211 skip 234 <empty>
I would like to have D1 and C2 highlighted, independently.
I can get part way by using a custom formula in CF:
=A1=min({$A1,$B1,$D1,$E1})
However I'm running into a couple of issues:
Zeros and empty cells are highlighted (which I don't want)
How to apply CF to each row independently without manually creating CF for each row (i.e. without having to do =A2=min({$A2,$B2,$D2,$E2}), =A3=min({$A3,$B3,$D3,$E3}), etc.)
AI: I found another way to do it with a single CF formula using ArrayFormula:
=A1=ArrayFormula((MIN(IF({$A1,$B1,$D1,$E1}>0,{A1,$B1,$D1,$E1}))))
The key is to also Apply to Range:
A1:A,B1:B,D1:D,E1:E |
H: Applying Conditional Formatting Color Scale to non-numerical cells
My column A is numerical, and I can apply conditional formatting color scales. However, I also want column B to be coloured according to the scale. The scale formatting does not accept formulas and will ignore non-numerical cells in the range, so I'm not sure how to do this.
AI: As pnuts suggested, an Apps Script is currently the only way to do this. Here is how one can paint column B the same colors as column A:
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getRange("B2:B").setBackgrounds(sheet.getRange("A2:A").getBackgrounds());
However, you probably want these colors to remain in sync if changes are made to column A. This calls for an onEdit trigger, in which the function checks that the edit was made to column A of a certain sheet, and repaints if necessary.
function onEdit(e) {
if (e.range.getColumn() == 1 && e.range.getSheet().getSheetName() == "Sheet1") {
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getRange("B2:B").setBackgrounds(sheet.getRange("A2:A").getBackgrounds());
}
}
This script tracks column A (== 1 is its number) of the sheet named "Sheet1". |
H: What is the mechanics of items in multiple folders
It is (only so) well-known that an item in Google Drive can reside in multiple locations at once. There is a trace of documentation about how to place a file in a second location in the Drive Help ("Move a file or folder" -> "Save an item to multiple folders") as well as a couple of alternatives here on StackExchange: With Google Drive, how can I have a single document in multiple folders/collections?
However, the mechanics of this after a "second" file has been created like this is highly unclear.
For example:
Is there any difference between the "second" and the original file? In other words, does the second file behave like a soft or hard link to the original file?
If there is a difference, how do you find out which copy is the original one?
What happens to the second file if you move the original file to a new location?
And vice versa?
What happens to the second file if you rename the original file?
And vice versa?
What happens to the second file if you delete the original file?
And vice versa?
What happens to the second file if you delete a folder containing the original file?
And vice versa?
What happens if you drag and drop the second file to the location where the original file resides?
And vice versa?
What if you manipulate the files in the Google Drive client on Windows (or Linux)?
What if the "file" in all of the above is actually a folder itself?
From personal experience, I suspect that:
If there is a difference, how do you find out which copy is the original one?
It seems as if the multiple locations are shown in chronological order of creation.
I have also read this blog post, and it seems to suggest the following partial answers:
Is there any difference between the "second" and the original file?
It does not look like there is!
What happens to the second file if you delete the original file?
And vice versa?
It looks like both copies are deleted.
AI: Short answer
Adding a file to multiple folders is a "mechanism" to show the same file in multiple folders, this doesn't make several copies of the same file.
Explanation
Google Drive works in very different way than other the file management systems that many end-users are used to use on theirs personal computers and file storage devices like USB memory sticks and portable hard drives.
Google Drive is a cloud file management system meaning that files are stored in large data centers that could have many "file copies" in order to serve the files as fast as possible to the end-user and to keep the files safe from a storage device failure. This copies are not directly available to the end-user. We could call these copies as "backup copies".
When a file is deleted, no matter how many folders it was added, as it's only one file it's deleted from everywhere and "slowly" all the backup copies will be deleted too.
Side note
On the earliests versions, when Google Drive and the Google Docs Editors were a single web app, instead of folders there was labels in a similar way that occurs on Gmail until today. I personally prefer to think on "labels" rather than "folders" as a mean to organize files.
References
Organizing Chaos: Folders vs Labels vs Search, a blog post from 2007 |
H: Stop Chrome from asking me which account I want to log in as?
A while back I logged into an application using another account from my company. Now whenever I go back to that application, I am routed to the URL:
https://accounts.google.com/AccountChooser?{giant query string}
and it presents me with this window:
Is there a way I can remove the "Rift Valley" account from chrome's history so that it never has to ask me this again? I've seen suggestions that it can be removed from various sections of chrome://settings/ including:
People
Advanced -> Passwords and Forms
Probably a few others....
But none of them seem to contain this account that keeps getting suggested. How can I remove this so Chrome stops asking me if I want to log in as them?
AI: If you are signed out of all Google Accounts, this "choose account" page should show a button for "Remove" at the bottom (next to the "Add account" button).
Click on "Remove", and each account will show an "X" next to it. Just click the "X" next to the account you wish to remove, and then click "Done" at the bottom. |
H: How to append rows from multiple sheets into one "master sheet"?
I've created several small sheets, all with the same number of columns, and I'd like to produce one large sheet consisting of all the rows from the smaller sheets. I don't want to perform any deduplication, since each row contains important data.
Is there any way I can do this? The closest thing I've been able to find is:
={'Sheet1'!A:D, 'Sheet2'!A:D}
The trouble here is that the columns are appended to one another, not the rows. Meanwhile, if I do this (note the semicolon instead of the comma):
={'Sheet1'!A:D; 'Sheet2'!A:D}
I get the data from the first sheet and no data from the second.
AI: Give row numbers instead of column letters, and separate the ranges by semicolon ; (vertical stacking instead of horizontal).
={Sheet1!1:3; Sheet2!2:7}
This assumes both sheets 1 and 2 have the same number of columns. If this is not the case, you'll need to specify which columns you want:
={Sheet1!A1:Z3; Sheet2!A2:Z7}
To get all rows of another sheet, use a construction with indirect:
=arrayformula({Sheet1!1:4; indirect("Sheet2!1:" & max(row(Sheet2!A:A)))})
Here, "Sheet2!1:" & max(row(Sheet2!A:A)) constructs a string such as "Sheet2!1:1000", with the latter number obtained as the maximum of row numbers. |
H: Does Google Docs support variables?
Similar to Microsoft Word DocProperties where you're able to use update a DocProperty value as metadata, and its value gets update in the whole document.
Does Google Docs have something similar?
(I'm planning on modifying said variable's value programmatically from the outside of the document via a script.)
AI: Short answer
Yes, Google Documents, Spreadsheets and Forms have something similar -> Properties Service, and more specifically the properties class.
Explanation
The extension mechanism for Google Documents, Spreadsheets and Forms is Google Apps Script. See the following guide: Extending Google Docs |
H: Cannot block Google Calendar popups
I blocked notifications for Google Calendar, I blocked pop-ups for Google Calendar, I clicked "prevent this site from creating another dialogs" everytime an event reminder popped up yet it STILL pops up event reminders.
I want to be reminded, I just do not want Chrome to remind me. I have my phone, my apps for that. The problem with this chrome popup is that it is very forceful in stealing focus. When you are working with virtual desktops, it also results in switching contexts like crazy and sometimes even onto an incorrect context, so I have to look for where that popup is actually present and then "click ok",.
Why is Google Calendar not respecting when I ask on three places to shut up? I cannot turn off notifications for events, because then they would not pop up elsewhere (where I want them to).
AI: Okay, I found a workaround. It is not perfect, but unless someone has a better way, it might be helpful for others.
In Google Calendar settings you can choose to be reminded with browser notifications instead of interruptive alerts. You must, however, allow notifications if you have already blocked them, for the page in Chrome (if you are using it, by clicking on the green lock symbol to the left of the address in address bar and selecting allow for notifications. I have also allowed for pop-ups, not sure if that is necessary, but blocking did not help).
If you try to block notifications and pop-ups, google calendar will fall back to alerting you with the intrusive alert, so you cannot go without some notifications. However, the browser notification does not steal your focus, nor does it switch virtual desktops. It just pops up into your view and you can close it. |
H: What is the .onebin file in OneNote 2013 cache folder?
I see a lot of .onebin files in OneNote cache folder. As recently I had problems with lost changes in an offline copy I want to know if it's possible to recover information from this files.
AI: This take me some time, because on internet I couldn't find information about .onebin extension, but if you go to the unzipped folder OneNoteOfflineCache_Files it contains the binary original files, so you can rename it and use to recover information (knowing the date of creation may help...). In my case I have recovered images as .jpg and some excel (xlsx) files. |
H: How to recover lost information when working offline in OneNote?
I was working offline in a project when OneNote was frozen (message with "loading..."). When I connected to the network and reopened OneNote it synchronized with the good copy of the "cloud", but all my workday has been lost.
Someone here can help me?
Any idea if I can recover "unsaved changes" as in Excel and Word?
I think my changes should be on any place in my PC.
AI: It take me some time but finally after reading a lot I recovered all my work thanks to the OneNote cache and reapair tool.
Here are the steps to recover lost data:
First of all, I made a backup of all the onenote folder from "C:\Users\\AppData\Local\Microsoft\OneNote\15.0\OneNoteOfflineCache_Files" in a zip. You should do this. Important: You must do it as soon as possible to avoid losing data.
Create folder c:\bak and unziped the OnenoteCache Files and Folders (OneNoteOfflineCache.onecache and OneNoteOfflineCache_Files)
Rename OneNoteOfflineCache.onecache to OneNoteOfflineCache.one
Execute OneNote.exe /forcerepair c:\bak\OneNoteOfflineCache.one and wait to finish
Now you can open the file and search for your lost sections/pages. The main issue is that embbeded files like images are not recovered (I'm not tested what happens if you restore from original location of the cache. It may recover images and binary files..)
This take me some time, because on internet I couldn't find information about .onebin extension, but if you go to the unzipped folder OneNoteOfflineCache_Files it contains the binary original files, so you can rename it and use to recover information (knowing the date of creation may help...). In my case I have recovered images as .jpg and some excel (xlsx) files. |
H: Google Spreadsheet SUMIF aggregation - multiple strings in condition
How to use Google Spreadsheet SUMIF agregation function with more than one condition?
What I currently have is formula:
=SUMIF( A1:A50, "match_this",B1:B50)
But I want to improve it to have 2 conditions:
=SUMIF( A1:A50, _ONE_OF_("match_this", "match_that"),B1:B50)
Is there operand like my imaginary _ONE_OF_ or what is the most simple, and correct way to handle this?
AI: One way to achieve this is by combining sum with filter. The filter can use several conditions, which may be joined by + (meaning OR), or by * (meaning AND). Example:
=sum(filter(B1:B50, (A1:A50 = "match_this") + (A1:A50 = "match_that")))
sums the entries in B1:B50 where A1:A50 is either of two things.
Notes
There is sumifs but it joins conditions only as AND
There is or but it's not supported by sumif
The great flexibility of filter is that it focuses on one thing: filtering a range by a condition. You can apply any function you want to the filtered results: sum, product, count, maximum, etc. Also, the condition can be expressed by any formula, not constrained by a rigid syntax of sumif and its relatives. For example, advanced string filtering can be done with regexmatch. |
H: How can I search Craigslist for a phrase that includes quotation marks?
I want to search Craigslist for a TV that is not 22 inches or 32 inches and isn't broken, etc.
So my query was: tv|television -projection|plasma|apple|broken -22" -32".
Here is the actual search.
But the double quotes is messing it up (because a pair of double quotes usually indicates a phrase). I probably need to escape those special characters somehow.
Craigslist Search Help does not specify what I'm doing wrong.
What search query will achieve my goal?
AI: After reading Craigslist's Advance Search instructions, I don't think your search can be done. But I have a couple alternatives that might get you closer to the results you want.
Use wildcards instead of quotes: tv|television -projection|plasma|apple|broken -22* -32*
Just omit the quotes: tv|television -projection|plasma|apple|broken -22 -32
Both of those queries do return results. Unfortunately, they probably don't return some results that you would like to see (because of false positive matches). |
H: Join cells and headers value in a row with Google Sheets filtering blank cells
I would like to know how to filter and join each row adding the header before the values addin a ":" beetween Header and Value and separating them with ";". If the value is blank the header don't have to be selected.
Gender
FemaleMan
Category
XYZABC
Weight
4530
Elasticity
HighMedium
The result need to be:
Features
Category:XYZ;Weight:45;Elasticity:High
Gender:Female;Elasticity:Medium
Gender:Male;Category:ABC;Weigh:30
I'm playing with arrayformula, join and filter functions but I can't figured out how to "loop" to join header with values, maybe I simply don't know what function I have to use.
(If possibile I would like to avoid the use of Google Script)
AI: Assuming your data is in the upper-left corner of a sheet, the following works (linebreaks added for readability):
=arrayformula(
regexreplace(
regexreplace(
if(len(A2:A), A1 & ":" & A2:A, "")
& ";" &
if(len(B2:B), B1 & ":" & B2:B, "")
& ";" &
if(len(C2:C), C1 & ":" & C2:C, ""),
";+", ";"),
"^;|;$", "")
)
Each if processes one column of data, prepending values by headers if the value is nonempty. The ; are inserted in between.
The regexreplace perform a cleanup. The first one replaces any sequence of semicolons by a single semicolon. The second removes the semicolon at the beginning or end of string.
Although it's tempting to try join(";", ...) here (which wouldn't require the cleanup), it can't handle a two-dimensional array of data. |
H: Query a Google Spreadsheets using several different values
I'm trying to figure out how to update the following Google Spreadsheets query function so it can search column "J" for three or more separate values. If any of the values are present in column "J", I need the query to return the 'select' data in column B, C, D, etc.
=query(data!B2:BK,"select B, C, D, E, F, G, H, I, J, K, L, M, N, BA where J = 'Guest Speaker'",false)
So if "J" equals Guest Speaker or Field Trip or Anything, it will return data from B, C, D, etc.
AI: As query language documentation says,
You can join multiple conditions using the logical operators and, or, and not. Parentheses can be used to define explicit precedence.
Example:
select * where J = 'Guest Speaker' or J = 'Field Trip' or J = 'Anything' |
H: How do I avoid hitting user Quota Limit
The following Script grabs all my contacts from specific group into a Google Sheet. Ideally I'd like to have it run as often as possible. Currently, with a trigger set to every 1hr, I receive the following quota limit after about 3 hours. After 12 hours of hitting the quota, it resumes for 3 hours and repeats.
Temporary problem - please try again later and consider using batch operations. The user is over quota.
Aren't quotas on a 24 hr cycle? Is there something wrong with my script?
function onOpen()
{
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [];
menuEntries.push( {name: "Read Contacts", functionName: "readContacts"} );
spreadsheet.addMenu("Contacts", menuEntries);
};
function readContacts() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Contacts");
var group = ContactsApp.getContactGroup('Apptivo Contacts');
var contacts = ContactsApp.getContactsByGroup(group);
var ContactArray = new Array();
var ContactArrays = [];
ContactArray = [];
ContactArray.push("");
ContactArray.push("FullName");
ContactArray.push("Emails");
ContactArray.push("PhoneNumbers");
ContactArray.push("Company");
ContactArray.push("Job Title");
ContactArray.push("Notes");
ContactArray.push("HomeAddress");
ContactArray.push("WorkAddress");
ContactArray.push("URL");
ContactArray.push("Groups");
ContactArrays.push(ContactArray);
for (var i=0;i<contacts.length;i++)
{
ContactArray = [];
ContactArray.push("");
//FullName
ContactArray.push(contacts[i].getFullName());
//Emails
var Emails = "";
for ( var g=0;g<contacts[i].getEmails().length;g++)
{
Emails += contacts[i].getEmails()[g].getAddress();
if (g + 1 == contacts[i].getEmails().length) break
Emails += "\n";
}
try{ContactArray.push(Emails);}
catch(e){ContactArray.push("N/A")}
//Phone Numbers
var Phones = "";
for ( var g=0;g<contacts[i].getPhones().length;g++)
{
if (contacts[i].getPhones()[g].getLabel() == "MOBILE_PHONE") {
Phones += "C: "
} else if (contacts[i].getPhones()[g].getLabel() == "WORK_PHONE") {
Phones += "W: "
} else if (contacts[i].getPhones()[g].getLabel() == "HOME_PHONE") {
Phones += "H: "
} else if (contacts[i].getPhones()[g].getLabel() == "HOME_FAX") {
Phones += "F: "
} else if (contacts[i].getPhones()[g].getLabel() == "WORK_FAX") {
Phones += "F: "
} else {
Phones += "O: "
}
Phones += contacts[i].getPhones()[g].getPhoneNumber();
if (g + 1 == contacts[i].getPhones().length) break
Phones += "\n" ;
}
try{ContactArray.push(Phones);}
catch(e){ContactArray.push("N/A")}
//Company
try{ContactArray.push(contacts[i].getCompanies()[0].getCompanyName());}
catch(e){ContactArray.push("N/A")}
//JobTitle
try{ContactArray.push(contacts[i].getCompanies()[0].getJobTitle());}
catch(e){ContactArray.push("N/A")}
//Notes
ContactArray.push(contacts[i].getNotes());
//Addresses
var homeAddress = "" , workAddress = "";
for ( var g=0;g<contacts[i].getAddresses().length;g++)
{
if (contacts[i].getAddresses()[g].getLabel() == "HOME_ADDRESS") {
homeAddress += contacts[i].getAddresses()[g].getAddress();
} else if (contacts[i].getAddresses()[g].getLabel() == "WORK_ADDRESS") {
workAddress += contacts[i].getAddresses()[g].getAddress();
}
}
//Home
try{ContactArray.push(homeAddress);}
catch(e){ContactArray.push("N/A")}
//Work
try{ContactArray.push(workAddress);}
catch(e){ContactArray.push("N/A")}
//URLs
try{ContactArray.push(contacts[i].getUrls()[0].getAddress());}
catch(e){ContactArray.push("N/A")}
//Groups
var ListofGroups = "";
for ( var g=0;g<contacts[i].getContactGroups().length;g++)
{
ListofGroups += contacts[i].getContactGroups()[g].getName();
ListofGroups += " | ";
}
try{ContactArray.push(ListofGroups);}
catch(e){ContactArray.push("N/A")}
ContactArrays.push(ContactArray);
}
//If Array is not blank(to avoid quota issues)
if (12 < ContactArrays.length) {
// Re-populate sheet
sheet.clear();
sheet.getRange(1,1,ContactArrays.length,ContactArrays[0].length).setValues(ContactArrays);
}
};
AI: I think there is room to reduce the number of get* calls in your script -- these calls are what drains the Google Services quota. To start with a simple example,
for ( var g=0;g<contacts[i].getEmails().length;g++)
{
Emails += contacts[i].getEmails()[g].getAddress();
if (g + 1 == contacts[i].getEmails().length) break
Emails += "\n";
}
can be replaced with
var contactEmails = contacts[i].getEmails();
for ( var g=0; g<contactEmails.length;g++)
{
Emails += contactEmails[g].getAddress();
if (g + 1 == contactEmails.length) break
Emails += "\n";
}
Although this doesn't affect the quotas, I'll mention map and join methods of JavaScript arrays, which could shorten the above to
var Emails = contacts[i].getEmails().map(function(email) {
return email.getAddress();
}).join("\n");
Similarly, the repeated calls to contacts[i].getPhones() should be replaced with one var contactPhones = contacts[i].getPhones();, and subsequent work should happen with this array.
Same for companies, addresses, groups, etc. |
H: Google Sheets QUERY won't display cell text if other cells have numbers
I'm not sure what is happening in my Google Sheet query and could really use some help. I have a quick screencast that demonstrates and explains the issue.
Basically, I'm using a query to pull data from a Google Spreadsheet that is populated by a Google Form. If the form submits only numbers (100), there is no problem. However, if someone submits a string ($100 or 100 dollars), the query will not display the string. It will only display form submissions that are 100% numbers.
Also, if the 1st submission is a string (not 100% numbers) the query will work.
Here is my query
=query(data!B2:CL,"select B, C, D, E, F, G, H, I, J, CI, BZ, CA, BA where J = 'Industry Certification'",false)
Any ideas on why this is happening?
Also, I'm aware that I can limit the form to numbers only. I'm trying to avoid that and learn 'why' this is happening.
AI: A good place to start is documentation:
In case of mixed data types in a single column, the majority data type determines the data type of the column for query purposes. Minority data types are considered null values.
In other words, if you have a bunch of numbers and some text in the same column, the text will be ignored.
If you allow mixed data types within a column, query is not for you. You may be able to achieve the desired result with filter. The following example with filter is equivalent to the query in the question:
=filter({data!B2:J, data!CI2:CI, data!BZ2:BZ, data!CA2:CA, data!BA2:BA}, data!J2:J = "Industry Certification")
The first argument is an array of data to be filtered (with { } used to combine non-adjacent columns). The second is an array of True/False values to be used as a filter. Multiple conditions can be used. |
H: QUERY error for BY column
I'm using the following query to pull data from one sheet into another.
=query(data!B2:CL,"select B, C, D, E, F, G, H, I, J, BB, BZ, CA, BA where J = 'Industry Certification'",false)
The above query works perfectly. However, if I change 'BB' to 'BY'. I get the following error.
Error
Unable to parse query string for Function QUERY parameter 2:
PARSE_ERROR: Encountered "BY" at line 1, column 35. Was expecting one
of: "true" ... "false" ... "date" ... "timeofday" ... "datetime" ...
"timestamp" ... "min" ... "max" ... "avg" ... "count" ... "sum" ...
"no_values" ... "no_format" ... "is" ... "null" ... "year" ... "month"
... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ...
"with" ... "contains" ... "starts" ... "ends" ... "matches" ... "like"
... "now" ... "dateDiff" ... "quarter" ... "lower" ... "upper" ...
"dayOfWeek" ... "toDate" ... ... ...
... ... ... "(" ... "-"
...
The value of cell 'BY' is a simple string (activities).
I'm scratching my head confused. Any help is greatly appreciated.
AI: Short answer
According to the documentation, BY is a reserved word, to use it as an identifier, it should be back-quoted.
Explanation
I think that it's a reserved word because it's used by two clauses:
Order By
Group By |
H: How to set input type = "tel" to the answer input field?
In my Google Form I've got multiple text questions with answers with data validatation set to numbers only. Unfortunately when I enter the answers using the mobile browser the keyboard shown is full, not numbers only.
So I want to change the input type of all those fields to "tel". It should be possible if I found the way to manipulate DOM of the form after form loads. However my Google Apps Script knowledge is very limited.
My question is: Could you write the example of the function which changes input fields' type of Google Form after it loads?
AI: Short answer
This could be done by using the Url Fetch and Html Service from Google Apps Script.
Explanation
With UrlFetchApp you could do GET/POST to the Google Forms servers, get the response to manipulate it and finally serve it as a web page by using the Html Service.
The broad idea behind the above was "on the wild" from a time ago. If found mentions of a Google Forms add-on called FormFuse that I think that works this way and a WordPress plug-in that does something similar.
It's worth to mention that currently there are two versions of Google Forms, the old and the new, as they are called by Google. The new version are generathe by Google Closure Compiler and the compiled form uses the JSAction library. The old version uses regular html forms, for me, this version is easier than the newer, as there are some tutorials that were made based on this version, like https://morningstudio.com.au/blog/2013/06/how-to-style-google-forms/. This tutorial doesn't use Google Apps Script but shows the broad concept.
A visual walk-through will be too long for this format. Please learn as much as you can of Google Apps Script and post new specific follow up questions.
Resources
Google Apps Script
Related questions
Google Forms hidding options on mobile devices
How can I change the default text on the "Submit" button?
Google forms hierarchical multiple choice questions |
H: How to upload a high quality video to Instagram?
I have an 1080p HD video edited on a computer that I'd like to upload to Instagram. The issue is that on my first attempt, even though I selected landscape format instead of the square format, Instagram re-compressed the video and it looks terrible.
How can I avoid compression when uploading a 1080p video to Instagram?
(So far I found this Reddit post about the issue - I couldn't find any recommended video settings (dimensions/frame rate/bit rate/etc.) on Instagram help.)
AI: You can upload within the below limits:
Size: Maximum width: 1080 pixels (any height)
Frame Rate: 29.96 frames per second
Codec: H.264 codec / MP4
Bit-rate: 3,500 kbps video bitrate
Audio: AAC audio codec at 44.1 kHz mono
Length: 60 seconds
Filesize: 15MB
Hope it helps |
H: How to replace a video in an existing post on Instagram?
The video quality after upload/Instagram compression looks terrible and I'd like to replace/improve the video but maintain the post (and likes/comments/etc.)
Is it possible to replace the video in an existing Instagram post?
AI: You can only alter the caption of the video but not the actual video itself.
I see you have posted one more question related to the information regarding Instagram video, check out my answer here |
H: Can other Gmail users access my Google Drive files?
I have many files sitting in my Google Drive account. My account is probably set to whatever the default settings are. I am the only individual with access to my Gmail password.
Can other individuals (people I consistently email, people in friends with on Google Plus) get access to these files? Can they download these files or get any access to them (note that my settings are likely set to the default settings) if they are simply sitting in my Google Drive?
AI: No. Only your account has access to those files. You have to explicitly share files for other people to see them. |
H: In Google Sheets, is there a way to name a cell?
For example, in a spreadsheet, if I have a cell that has a number, is there a way to name it for other cells to use this name as part of the formula?
Example: With the number 3% is in a cell, to name it as InterestRate or IR, and be able to use that in another cell: = SQRT(InterestRate) or = SQRT(IR)
AI: From the Google Docs support page:
To Name a range
Open a spreadsheet in Google Sheets.
Select the cells you want to name.
Click Data > Named ranges. A menu will open on the right.
Type the range name you want.
To change the range, click Spreadsheet Grid.
Select a range in the spreadsheet or type the new range into the text box, then click Ok.
Click Done.
For the full documentation on named ranges check Google Support. |
H: Error in Google Drive: "You are signed out. Sign back in, then click 'Retry'."
Upon visiting https://drive.google.com/ in Safari 10+, I have been experiencing very weird error message that I could not find a solution to:
You are not signed in
You are signed out. Sign back in, then click
'Retry'.
This did not allow access to my file list and I was forced to use Chrome or Firefox which worked fine.
Searching the error message on the Internet gives no results. I hope to fix that with this Q&A.
AI: In Safari, I had enabled:
Develop -> Disable Cross-Origin Restrictions
which caused the problem. Disabling the checkbox solves the error. |
H: Google Sheets Query to select a large range of columns without manually entering each column
I have a column with dozens and dozens of columns in it that I'm querying data from. I'm using something similar to below to do this, but I'm wondering if there is an easier way? For instance, something like "Select B:Z where K = X" or "Select B through Z where K = X" or "Select * excluding S where K = X"?
=QUERY(data!B1:J30000, "Select B, C, D, E, F,.......
Is it possible to select columns based on a 'range' instead of manually entering each column?
AI: You can generate a comma-separated string of column names with a formula such as
=arrayformula(join(",", substitute(address(1, column(C:F), 4), "1", "")))
(here C:F is the example of a range of columns). The above formula returns the string C,D,E,F which is suitable for use in a query. Optionally, the arrayformula part can go outside. Example:
=arrayformula(query(A1:F, "select " & join(",", substitute(address(1, column(C:F), 4), "1", "")) & " where A <> ''"))
For a short range like C:F this obviously isn't worth the effort, but if you have something like M:AT, then it's probably going to save time.
Explanation
column returns a column number
address returns A1 notation of the cell at the top of that column (option 4 means no $ will be used)
substitute removes row number 1
join joins by commas |
H: How do I compare two Range objects?
I have two Range variables. How can I make sure that they belong to the same Sheet and reference the same set of cells?
For example:
var mySheet = // ...
function onEdit(e) {
var range1 = e.range;
var range2 = mySheet.getRange(123, 234);
if (areEqual(range1, range2)) {
// cell (123, 234) was edited,
// let's do stuff
}
}
What should I write instead of areEqual?
AI: Instead of checking row, column, width and height, you can just compare the A1 notations (like A1:B2), in combination with something that identifies the sheet:
function areEqual(r1, r2) {
return r1.getGridId() === r2.getGridId()
&& r1.getA1Notation() === r2.getA1Notation()
}
range.getGridId() uniquely identifies a sheet the range belongs to (within a spreadsheet).
See the documentation for the Range object, and the getA1Notation() and getGridId() in particular.
You can shorten it even further by just comparing range.getDataSourceUrl():
function areEqual(r1, r2) {
return r1.getDataSourceUrl() === r2.getDataSourceUrl()
} |
H: How to Google search videos from websites other than YouTube?
I want to Google search for videos on "JavaScript". However, I want search results from websites other than YouTube. How can I do that?
Since I want video results, I selected the Videos tab on the Google search results page. But how to exclude YouTube results? The operators page doesn't offer any suggestions to this effect..
AI: The page you're linking to does describe how to do that:
When you use a dash before a word or site, it excludes sites with that
info from your results. This is useful for words with multiple
meanings, like Jaguar the car brand and jaguar the animal. Examples:
jaguar speed -car or pandas -site:wikipedia.org
Do a video search for javascript -site:youtube.com to exclude results from youtube.com.
Note the dash: If you searched for javascript site:youtube.com you would restrict results to only videos from youtube.com. From the same documentation page:
site: Get results from certain sites or domains. Example:
olympics site:nbc.com
To get results from multiple sites or domains,
combine with OR. Example: Olympics site:nbc.com OR site:.gov |
H: How to paste source code in Google docs without creating bunch of new paragraphs?
When I paste source code in Google docs document, every line of the source is on a new paragraph. That creates unnatural spacing between lines.
I can manually fix this by tediously removing each paragraph and then inserting new line with Shift+Enter. But is there a way to avoid having bunch of paragraphs for every new line?
AI: It sounds as though formatting is being carried over from your source code editor. If you don't mind removing all formatting (such as colors & fonts), this is what I've done on a PC:
Copy the source code.
Paste it into Notepad, which has no formatting features. It will strip away all existing formatting.
"Select All" in Notepad, and copy the text.
Paste that into the Google Document.
There is probably a similar Mac program that will strip away formatting, if you need it. |
H: How do I make a new Category on my Gmail Account?
I was using Gmail and needed to organize something into a category (that would show on for Configuring my Inbox) which I wanted to make specifically for it. Although I noticed that it only allows me to configure my inbox with categories such as Social, Promotions, Updates, and Forums. Does anyone know how to make a brand new category and put it as a tab on my Gmail Inbox?
AI: The categories are created by Google and not user defined. You can create labels and attach them to emails but what you're asking is not possible |
H: Prevent people sharing my Facebook business page's posts
Is there any way to prevent people from sharing posts of my Facebook business page?
AI: Pages are public spaces, so they're visible to everyone. Anyone can view and share, even banned people are able to view and share posts from your Page on their own timeline (but banned people can't interact with your posts through comments or likes).
As of now there in no official way to prevent people to share post from the page. |
H: How to create a new paragraph within a list item?
I am maintaining a Google docs document that contains questions and answers for programming tests in our university. It's public, so you can see it.
The problem I have is that every item is a list item.
Question 1
Answer 1
Question 2
Answer 2
I can add line breaks with Shift+Enter, but that's not a paragraph. This now became REALLY annoying because the Code Pretty plugin apparently cannot format only selected code, but formats whole paragraph. That, of course, includes question and answer text.
I'd like to make indented paragraphs for code within each answer (if it contains code). How to do that?
Should look like this, but what you see is a mess of newlines and tabs:
AI: Ok, I found a hack to do this. Press enter to create new list item and then create a third one:
The third item prevents you from being unable to continue the list later on. Now press tab to indent the second item:
And finally, press back space to "delete" the indented item. It will become a paragraph:
It prevents you from continuing the list though. |
H: Generating various email responses based on results from one Google Forms
I have a google form that has multiple sections and a different set of questions depending on the answer to the first multiple choices. I want to be able to send an email and use a different body message for each of the sections. Below is a snippet of the code
function myFunction(e){
var accountType = e.values[1];
var personName = e.values[2];
var personAddress = e.values[3];
var businessName = e.values[4];
var businessAddress = e.values[5];
var charityName = e.values[6];
var charityAddress = e.values[7];
var subject = "Webform " + accountType + ;
var message = "Application received from " + personName + " of " + personAddress;
MailApp.sendEmail (userEmail, subject, message);
}
I need to have it send a different message (email body) when specific text has been entered into variable "accountType" will create a different email message (body)?
AI: You will want to use an if/else statement to achieve the desired outcome, threw it together quickly but it should look like what I have below:
if (accountType = 'account_type-1') {
var message = "Application received from " + personName + " of " + personAddress;
} else {
if (accountType = 'account_type-2') {
var message = "Different Application received from " + personName + "of " + personAddress;
}
} |
H: Passing variable to Google Apps Script Deployed web application
I am developing a spreadsheet where a user clicks a link in the sheet to call a deployed web app as described here Trigger Script in Spreadsheet in Similar Fashion to a Link
This works well although I need to somehow identify the row of the calling cell that the user clicked the link. So if the
=HYPERLINK("https://script.google.com/macros/s/ ... /exec"¶ms())
Is in cell E1, I need the functions called to know the calling row is "1". I tried GetActiveCell within the params function and I keep getting a range error. I also tried passing the row directly to the params() function through the calling hyperlink and it did not receive the value [I tried as (1) and ("1")]. Is there a way to pass a value to the params function?
=HYPERLINK("https://script.google.com/macros/s/ ... /exec"¶ms(1))
Can anyone offer any help / suggestions? It would be greatly appreciated!
AI: You can modify the function params to accept the argument it's given, and use it in forming the string that it returns. Like so:
function params(row) { // added row here
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ssid = ss.getId();
var sheet = ss.getActiveSheet();
var sheetName = sheet.getName();
return '?ssid='+ssid+'&name='+sheetName+'&row='+row; // added row here
}
Now when you use ...exec" & params(1)) the value of 1 will be correctly appended to the URL used to invoke the web app: the URL will have &row=1 and consequently, the doGet function of the web app will receive this value as e.parameters.row.
However it's easier to just append 1 yourself: in the hyperlink function, put
...exec" & params() & "&row=1" )
or
...exec" & params() & "&row=" & row() )
There is no need to run a number through a custom function when you can just append it to the URL in the spreadsheet. The reason the custom function params is needed is to pass the values that spreadsheet functions cannot access: spreadsheet id and sheet name. |
H: Yahoo! email acts very strangely after changing password
I just changed my account password. I can log into all other service of Yahoo!. But I just cannot log into the email service. I tried to access with browser it keeps asking for password though I've already logged in. I cannot use pop or imap to access it also. Anyone knows what happened? Do they stop to provide email service?
AI: After several tests. I finally find out the web email server need about 1-2 hours till the pwd modification propagate to it, do not ask me why, I do not know. The pop/imap pwd is changed immediately. However, the pop/imap pwd cannot be longer than 32. Do not ask me why yahoo does not match their pwd length limits cross its services ... But if you want your mail service to work properly you need to:
make sure your pwd length < 32 characters.
wait about 2 hours before you actually use the web interface to access your email. |
H: In CommCare, which date case property references the date the case was created?
I want to close a case in a CommCare application (app built on CommCare opensource platform), and I would like to do so by creating a rule that references the date the case was opened. However when I look at an export of case data, I see two possible case properties, one in the export and one in the case list configuration drop down on CommCare HQ that could refer to case closure. I'm sure others have been confused by this: One case property is called "opened_date"(in the export), whereas in a case list configuration dropdown on CommCareHQ, the case property is "date-opened". Which one should I use when I create a rule for case closure based on the date the case was opened? I've checked the online commcare public confluence documentation but couldn't figure out which one to use.
AI: Just to add onto Ben's answer - CommCare and CommCare HQ have different representations of the case data which is why this is confusing. The case closure rules rely on CommCare HQ's representation which is why you would use opened_on. Unfortunately I don't think there is any easy way to view that format on CommCare HQ, but if you are technically minded you can inspect the source code. Mobile's representation, on the other hand, is much better documented. |
H: How to open a specific section of a Cognito form?
I would like to enter a specific section of a Cognito form. For example, I have this published form: https://www.cognitoforms.com/NMA3/BasicContactFormTest
Now, what I would like to do is to generate an URL that open a specific section, "SectionWanted" is the name of the section with a specific response for the question named 'Question'.
Is that possible?
AI: According to Cognito Support, for this kind of questions you should contact them using: https://www.cognitoforms.com/supportrequest/ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.