text
stringlengths 83
79.5k
|
---|
H: Google Form list question to send different data from displayed value on select option
Is there a way to have a Google Form list-type question pass different values on the backend (e.g., to its linked Google Spreadsheet) than what are displayed?
For example, under Provinces at
https://docs.google.com/forms/d/1r-Lab6FPRSWP69ihPEZ0SPLJoQzsf3C1S1XjLDT8Zuc/viewform
It would be great if the HTML <select ...> option of
<option value="Quebec">Quebec</option>
would instead get rendered as:
<option value="QC">Quebec</option>
AI: You can write a script that changes the names in abbreviations after all forms have been submitted.
It has been done for the States of USA.
See for the code on Github:
https://github.com/davegaeddert/google-sheets-us-states/blob/master/Code.gs |
H: Have formula copied to entire column in Google Sheets
I'm trying to make a spreadsheet that displays the average of a row, i.e. =average(c3:al3) and the function is in column AN3.
I want to copy that function down a row (but need to do this for 560 rows) and I need it to auto change from C3:AL3 to C4:AL4 (if this makes sense). I know I can do it by hand but that would be prohibitively time consuming. I can insert a row into a column wide formula (such as =average(c3:c560) and it will auto change it to =average(c3:561)) just want to know if can do the same or do it as a bulk action for rows.
AI: The easiest thing is to copy and paste; the change from c3:al3 to c4:al4, etc, will happen automatically. I would proceed as follows:
Enter the formula =average(c3:al3) in AN3.
Select cell AN3, press CTRL+C (or CMD+C
on Mac) to copy it (the cell itself, not the formula from the formula line).
Select the range AN3:AN562 (or whichever range you want to paste to).
Press CTRL+V (or CMD+V on Mac).
The formula that will actually appear in the cells will have appropriate row numbers.
A mouse-based way to do the same is to drag the formula down using the dot in the bottom right corner of the cell. |
H: Google Spreadsheet Formula to show heading
I have a Google Spreadsheet in which I am comparing projectors. Basically it has formulas to divide the bulb life/cost and contrast ratio/cost. Then it adds the total of the two and gives me a number. Using the max function I can determine which is the largest number in the set, but I would like to know if there is any formula to select the column header at the top based on the number.
If the highest number is under an Epson 2000. I want a formula to make it say Epson 2000.
AI: You can do this with a combination of the INDIRECT and MATCH functions.
In the last column of your table add the following formula in line with the data that you would like to determine the max of:
Google Spreadsheet
=INDIRECT(ADDRESS([Name_Row], MATCH(MAX([Data_Span]), [Data_Span], 0) + [Column_Offset]))
Excel
=INDIRECT(ADDRESS([Name_Row], MATCH(MAX([Data_Span]), [Data_Span]) + [Column_Offset]))
Where [Name_Row] is the index of the row where your projector names are (e.g. 1 if the projector names are in row 1), [Data_Span] is the span of values that you're trying to find the max of, and [Column_Offset] is the distance of your first data value from column A (e.g. 1 if your data starts in column B).
See picture . |
H: How to enable the display of 1080p HD videos on Vimeo instead of the 720p default
I often upload videos to Vimeo.
Last time I uploaded a video on Vimeo, I noticed that there was an option to display my videos in 1080p instead of 720p.
Who wouldn't want that, right?
So I clicked on the "there's an option for that" link that we can see above.
I was then taken to a FAQ page, where the explanation to achieve a 1080p presentation are quite difficult to grasp:
It reads "you’ll need to upgrade your video under the “Video File” tab of your Video Settings page."
Only... well, the "video file" tab of the video's settings page is where I just was:
And I really don't see any option to do that there!
AI: The option to upgrade a video to 1080p is there, but available only to Plus and PRO members:
Why can’t I upgrade my video to 1080p anymore?
Good news: Plus and PRO members no longer need to manually upgrade their videos to 1080p. If you’ve uploaded a 1080p source file, we’ll automatically make both a 720p and 1080p version. (Please note that Basic members are limited to 720p video at this time.)
The option should appear once/if you upgrade your account to Plus or PRO level. |
H: Create question in Google Form where all answer options calculate to 100%
I have this question in a survey I'm trying to build a percentage accumulation like so:
Put the % of how much you spend of your salary in the following
categories: [Food, Transport, Health, ...., Other]
I want to format the question in Google Forms such that:
For each category, the user can input/select a value between 0%-100%
It should validate that the accumulation of the percentages is 100%
I tried Google Forms first, but I was unsuccessful. Any suggestions to do it using Google Forms?
AI: Short answer
At this time, this is not possible with Google Forms.
Explanation
Google Forms doesn't have a question that allows multiple numeric answers and the answer validation only could be set for the related question, not for multiple questions at once.
New Google Forms question types:
Multiple choice
Checkbox
Short answer
Paragraph
Dropdown : Respondents choose an answer from a menu that drops down
Linear scale : Respondents rank something along a scale of numbers
Multiple choice grid : Respondents choose points on a grid
Old Google Forms question types
Text: Respondents provide short answers
Paragraph text: Respondents provide longer answers
Multiple choice: Respondents select one option from among several
Checkboxes: Respondents select as many options as they'd like
Choose from a list: Respondents select one option from a dropdown menu
Scale: Respondents rank something along a scale of numbers (e.g., from 1 to 5)
Grid: Respondents select a point from a two-dimensional grid
Date: Respondents use a calendar picker to enter a date
Time: Respondents select a time (either a time of day or a duration of time)
References
Add and edit questions, headers, images, videos, and page breaks - Google Docs editors Help
Validate answers in your form - Google Docs editors Help |
H: Remove application from Google Launcher
How to remove link for an application in new Google Launcher?
AI: From what I can see, you can't remove icons from the Google App Launcher. At best, you can move the apps you don't want to the bottom of the list.
From Google Support under "Customize your menu":
You can customize the launcher to show your favorite products at the top. To do this, drag and drop them within the menu.
Add more products
If you'd like to add one you don't see in the list:
Sign in to your Google Account.
Choose App launcher .
At the bottom of the menu, choose More.
Choose the Google products you want in your menu and drag to the top.
Obviously, you can move down as well as up, so that the apps you want are near the top. |
H: Search matching multiple distinct senders
How does one perform a search such that it matches multiple distinct senders in the sense that one may match emails from different senders. I.e. if you have received emails from the senders
alice@foo.com
and
bob@bar.com
what query would yield all emails from both alice and bob, regardless of whether or not they are joint recipients on an email or distinct senders?
AI: You can use the following filter in your search bar:
from:(alice@foo.com OR bob@bar.com)
This way allows even more complicated queries with several levels of parenthesis using the logical and and or operators. The same would work with destination addresses, replacing the keyword from with to. |
H: Gmail messages still auto-forwarded after destination email was removed
I set up a forward mail from my Gmail account (say B) to Gmail A. Every mail received in B gets forwarded to A and no copy of it is retained in B. Now I don't want that to happen. I want my emails for B to be stored in B. So I deleted my email address A from B's forward option. But still the mail gets forwarded from B to A. How do I stop this?
AI: This configuration sounds like you have actually have setup POP Download or IMAP Access. On both accounts check that these two settings are disabled.
Settings
Forwarding and POP/IMAP tab.
Select Disable POP
Select Disable IMAP
Click on Save Changes |
H: How do you unlike a merged page on Facebook?
A year ago I liked page A.1 on Facebook. Today, I want to unlike it. However, A.1 has merged with A.2 and A.2 now loads when I try to visit A.1.
I do not have A.2 liked (this is what displays on A.2 and A.2 does not link to A.1. I still have A.1 liked on my profile. How do I unlike A.1?
AI: I just figured out the answer to my issue. The solution is to not try to find the page that was liked, but to visit your profile likes sub-page and unlike the "dangling reference" from there via the dropdown element ("unlike"). |
H: Is there any way to "star" or "favorite" a message in a thread in Google Inbox?
Like it says on the tin. I have a single message in the middle of a long conversation that I want to highlight and have easy to find, rather than having to remember that it's message number 35 out of 80 (or something like that) in the thread.
Is there any way to mark a single message as highlighted in Inbox?
AI: No, I'm afraid there isn't. Your options for an individual message in a conversation are Reply, Forward, and Print.
Even if you "star" the message in Gmail, there's no indication of such in Inbox.
I think, at best, you can forward the message to yourself and then keep that pinned.
Do note that Inbox by Gmail is in wide preview, and they claim to be looking for your input. Use the "Feedback" tool to point out this lack. |
H: How to conditional format in Google sheets based on cell directly above it?
Tried to setup a conditional format. Overall idea, I want a number to go down, and be marked red if it is going up.
I tried this custom formula =if(F2>F3, true) trying to say, if the cell value is larger than the cell above it, mark it red.
I read in another answer that "Cell references without $ prefixes are adjusted automatically when applied to ranges as you would expect."
However it doesn't appear to be working. There are many cells where the value increased and they are not formatted correctly. I don't know of a way to see what the conditional format formula evaluates to.
AI: The upper left corner of the range is F2. The custom formula should be written as it applies to that cell. You have =if(F2>=F3,true) which means comparing the cell to the one below it.
To have comparison with the cell above, use =if(F2>F1, true) but it's simpler to write =F2>F1 which means the same thing. |
H: How to disable Backblaze's auto-renewal of the service?
I wonder how to disable Backblaze's auto-renewal of the service.
The best I could find was to remove my credit card information, but then it immediately delete my backup, as shown in the screenshot below. I want my backup not to be deleted till the last day of my contract.
AI: It is not possible.
Answer from their customer service:
Auto-billing is a required part of our terms and agreement, so there is no way to auto-cancel. You would need to manually cancel following these steps:
https://help.backblaze.com/entries/95526007-Canceling-an-Account
If you forget to cancel before the auto-renewal, you can let us know and we can issue a pro-rated refund for yearly and bi-yearly licenses.
(Needless to say I deleted my Backblaze account upon learning it) |
H: Is Delicious feeds API no longer supported?
I've used Delicious feeds, such as http://feeds.delicious.com/v2/rss/username/optional_tag for a few years, but it seems like recently (end of 2015) they stopped working.
Did Delicious drop support for their feeds, or is this a temporary glitch?
AI: New Server:
https://previous.delicious.com/v2/rss/....
but no news on delicious.com
Found it on:
http://www.dizzysoft.com/how-to-get-rss-feeds-from-the-new-delicious/
but since August, 2015 it did not show new links. |
H: Remove header and blank row from the results of a SUM, GROUP BY query
I have a two column table where one column is some sort of key where duplicates are allowed and the other column includes amounts.
I then have the following formula somewhere else on the sheet:
=QUERY(A1:B, "SELECT SUM(A) GROUP BY B")
The results of that query begin with 'sum', then a blank line, then the summed values:
How can I modify the existing formula so that I do not have the 'sum' header and the blank line (if I can at all)? I want to avoid using multiple cells to create the desired affect and I want to avoid scripting.
AI: To suppress the header, end the query string with label sum(A) ''.
The blank spot below the header comes up because the column B, besides the letters a,b,c, also contains a bunch of blank cells, which form a group of their own. Since you don't want them, add the clause where B<>''.
End result:
=query(A1:B, "select sum(A) where B<>'' group by B label sum(A) ''")
(Case doesn't matter: I prefer lowercase because more text fits into the same horizontal space.) |
H: Hide columns with certain dates on open
Got a sheet containing dates in the first row.
I would like to hide on open all columns (some are already hidden manually) left of the column which date is closest to the current date
AI: This requires a script with a function onOpen(). Since you are asking about dates and not times, I'm going to break my own advice "do not use .getValue on date/time cells".
Here is a script that does what you described: grabs the dates in the first row, compares them to the present time (ignoring the potential timezone issues: UTC in Google Script vs local time in Sheets), and picks the closest. Then hides the columns to the left of the closest.
function onOpen(e) {
var sheet = e.source.getSheetByName('Sheet1'); // or .getSheets()[0]; to apply to the first sheet.
var width = sheet.getDataRange().getWidth();
var dates = sheet.getRange(1, 1, 1, width).getValues().valueOf();
var today = Date.now();
var minDiff = 1e9;
var imin = 0;
for (var i = 0; i < dates[0].length; i++) {
if (Math.abs(dates[0][i]-today) < minDiff) {
imin = i;
minDiff = Math.abs(dates[0][i]-today);
}
}
sheet.hideColumns(1, imin);
}
Whether some of the columns were previously hidden doesn't matter.
You may want to play it safer by hiding one column less, with sheet.hideColumns(1, imin-1); to provide a cushion against timezone discrepancy. Also, nearest date could be before or after today's; this is also worth considering. |
H: Search Gmail for emails without any CC recipients
I have an email address that should not receive email directly, and want to set up an auto-responder if an email is received without a CC included. Essentially, a search for:
to:me@email.com cc:[nobody]
Is this possible?
AI: I don't think there is a complete solution to your question, but following filter is the closest thing I can come up.
-cc:(*@*.(arpa|root|aero|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw))
This will check only generic popular gTLDs domain, so all the new gLTDs will be excluded unless you add them in the list. You will get error message by Google stating too long strings if you add more (I'm not sure how many are allowed). |
H: How do I sum a column of cells by date?
I have a spreadsheet with these data (all of these dates and amounts are arbitrary):
A B
12/1/2015 700
1/7/2016 100
1/13/2016 200
2/5/2016 300
3/19/2016 500
and another column with the first date of each month. I'm trying to sum the data by month/year to get something like this:
E F
12/1/2015 700
1/1/2016 300
2/1/2016 300
3/1/2016 500
Entering the dates into the first column of the pseudo pivot table isn't the problem; it's summing the data by date. In column F, I've tried this:
=ARRAYFORMULA(SUM(IF(AND(MONTH($A$1:$A$5)=MONTH(E1), YEAR($A$1:$A$5)=YEAR(E1)), $B$1:$B$5)))
but this returns all zeros. How do I do this?
AI: As I was building this question, I figured out several ways to achieve this, so I went ahead and shared the information.
There are several ways to do this. The first is a variation on your original syntax, but using nested IF statements instead of IF and AND:
=ARRAYFORMULA(SUM(IF(MONTH($A$1:$A$5)=MONTH(E1), IF(YEAR($A$1:$A$5)=YEAR(E1), $B$1:$B$5))))
The second uses the FILTER function. This method will return a #N/A error if FILTER doesn't find any matches for the conditions. FILTER takes each condition as a separate argument:
=SUM(FILTER($B$1:$B$5, MONTH($A$1:$A$5)=MONTH(E1), YEAR($A$1:$A$5)=YEAR(E1)))
The third uses INDEX and SUMPRODUCT:
=INDEX(SUMPRODUCT((MONTH($A$2:$A$6)=MONTH(E2))*(YEAR($A$2:$A$6)=YEAR(E2))*$B$2:$B$6), 1)
In each of these examples, I assumed that the data were in columns A and B, the "pivot table" dates were in column E, and the aggregated data are placed in column F.
There might be a way to do this with the QUERY function that provides an interface to the Google Visualization API Query Language, but I'm not sure. I don't know if such a query would dynamically update, either. |
H: YouTube channel search
It appears the YouTube channel search feature has been removed. Example page:
http://youtube.com/channel/UClE2TcmrYlBn4L8WM_fnl_Q
Previously on pages such as this, you would have a search box for video for that
channel only.
Has it in fact been removed?
If so, why?
Is any workaround available to search a channel?
AI: You can use a query such as these in the standard YouTube search box. To get
channel videos:
intext:"the cinematic orchestra - topic"
Channel search:
intext:"the cinematic orchestra - topic" everyday
Channel search title:
intext:"the cinematic orchestra - topic" intitle:everyday
Or:
"clapham junction" intitle:"warpaint feeling alright"
What Are Google Search Operators? |
H: Google Spreadsheets: Sum values for each month
I would like to sum the values that match each month in a spreadsheet. The spreadsheet looks like this:
2015-12-10 15
2015-12-19 10
2016-01-02 15
2016-01-05 25
And I want to obtain this:
2015-12 25
2016-01 40
How can I do that?
I tried to look for a formula like =FOR or =SELECT but there is no such thing in Google Spreadsheets. Looks like I cannot select a range conditionally.
AI: The relevant commands are named filter and query. (There are also pivot table reports that could be used for summarizing data.) The details of implementation vary based on:
Whether your date strings like 2015-12-10 are formatted as strings or dates.
Whether you want to have 0 for months where no transactions are recorded (if so, then you have to provide the list of months for the summary table manually).
I'll give a version that operates with dates as dates (as they ought to be stored) and outputs data for all months present in the table (so, a month with no records will be absent).
The formula assumes the data is in columns A and B. Its explanation is below.
=query(arrayformula({year(A1:A)&"-"&right("0"&month(A1:A),2), B1:B}), "select Col1, sum(Col2) where Col2 is not null group by Col1 order by Col1 asc label Col1 'Month', sum(Col2) 'Total'")
Preparation
The formula arrayformula({year(A1:A)&"-"&right("0"&month(A1:A),2), B1:B}) prepares a table for querying. The second column is just your B column. The first column is the month (as text) in format 2016-01. The slightly cumbersome right("0"&month(A1:A),2) is there to get 01 rather than 1 for January.
Query
The query language is SQL-like. Here is the query string I used, with linebreaks:
select Col1, sum(Col2)
where Col2 is not null
group by Col1
order by Col1 asc
label Col1 'Month', sum(Col2) 'Total'
Here, Col1 and Col2 refer to the columns of the table prepared at the first step. The query selects months and the total for each month, sorting them in order. The labels are optional, inserted just to make the output look better.
Remark
If you don't want to have a long formula like that, the preparation step can be a separate formula, creating a helper table, which the query command can then refer to. |
H: Set a formula for all cells in a column
I would like to use a same formula for cells in a column. Instead of writing it for all cells, is there a way to set it in a cell and tell to apply this formula to all cells in a column (or any set of cells)?
If I use the fill handle, as suggested by @Michelfrancis Bustillos, I have then to correct all cells because I am using a static cell.
As you can see, I would like to set the H1 cell for all cells in the column E. But the fill handle set H2 for the cell E4, and so on for the next cells.
The spreadsheet: https://docs.google.com/spreadsheets/d/1fM1Rrwj_lrxiGoiLyKEQqsYfcPbw6sA4avP9oVBGuHE/edit?usp=sharing
AI: I would like to set the H1 cell for all cells in the column E. But the fill handle set H2 for the cell E4, and so on for the next cells.
This means you need an absolute reference: H$1 instead of H1. The dollar sign means this number will not be changed as the formula is propagated to other cells. |
H: How to turn a list of months string into a list of month numbers?
I have a table with month headers at the top:
January | February | March | ...
Is there a way with one formula that I can get a list of month numbers?
January | February | March | ...
--------+----------+-------+----
1 | 2 | 3 | ...
I saw this answer about turning a month string into a month number with =MONTH(DATEVALUE(A1 & " 1")) but when I tried to do =ARRAYVALUE(MONTH(DATEVALUE(A1:1 & " 1"))) it didn't work. In fact MONTH(DATEVALUE(A1:1 & " 1")) gives the same result as MONTH(DATEVALUE(A1 & " 1")).
AI: There is no arrayvalue command; there is arrayformula.
Yes, MONTH(DATEVALUE(A1:1 & " 1")) gives the same result as MONTH(DATEVALUE(A1 & " 1")) because without arrayformula, it expects one value as an argument. Given more, it only takes the first one.
The correct formula (tested in my spreadsheet) is
=ARRAYFORMULA(MONTH(DATEVALUE(A1:1 & " 1"))) |
H: What is the difference between the DELTA and EQ functions?
The new Google Sheets includes the DELTA function, which
Compare[s] two numeric values, returning 1 if they're equal.
How does this differ from the EQ? From what I can tell, the EQ function returns TRUE or FALSE, while the DELTA function returns 1 or 0. The DELTA function also has the option to only take one argument, which is compared against 0, but those seem like minor differences.
Are there any other differences between these functions? At first I thought DELTA was a fuzzy comparison function that compared two values within a given tolerance, but that doesn't seem to be the case.
AI: The name and concept of this function comes from Kronecker delta, and it is used for the same reason as it's used in mathematics and engineering: to include equality conditions into algebraic expressions. Excel had this function for a while; the old version of Google Sheets did not, which was noticed. So, if nothing else, better compatibility with Excel is a reason enough to add this function.
As an example, it can be used for things like "the number of places where the numbers in columns A and B agree":
=sum(arrayformula(delta(A1:A,B1:B)))
Of course there are other ways to do the same, like countif: the point of delta is that one could have it in a complex algebraic expression.
The above doesn't quite work with eq: the formula =sum(arrayformula(eq(A1:A,B1:B))) throws an error. One can get around it with =sum(arrayformula(1*eq(A1:A,B1:B))) by converting boolean to integer. |
H: Insert current date to cell based on content in other cell
Background:
I am trying to create a sheet which tracks my costs on daily basis. Instead of entering the current date everyday, I want the sheet to store the current day based on the content I enter in the Costs column.
For the cells in column C I use the following formula:
=if(D2="","empty",TODAY())
The problem with this function is that it updates everyday. As you can see from the picture the date on C appears as the most current date although the information there was inserted days ago.
Question:
How do I achieve that the content in the cells of column C stay only on the date of insertion content to column D and they do not update everyday to the current date?
AI: This is related to Is there any way to create a timestamp in a Google Spreadsheet? so my answer is similar to those, but adapted to your setup.
Automatic insertion: requires Apps Script
Use the following script (Tools > Script Editor):
function onEdit(e) {
if (e.range.getSheet().getSheetName() == 'Sheet1' && e.range.getColumn() == 4) {
e.range.offset(0,-1).setValue(e.value.length>0 ? new Date() : '');
}
}
On every edit, the script checks whether the edit was to "Sheet1" (put the name of the relevant sheet here) and to the column 4 (that is D). If so, it fills the cell directly to the left (offset(0,-1)) with the current date. Unless the edit removed content from column D; then the corresponding C cell becomes empty.
Manual insertion: no script
Make the habit of pressing Ctrl+; in column C when editing column D. This inserts the current date. |
H: Function name to add rows in Google Sheets
Is it possible to add rows with a built-in function (such as MIN() or INDIRECT()) in Google Sheets?
I would like to fill rows in the main sheet such as
+---+----+--------+
| A | 18 | Atext1 |
| A | 5 | Atext2 |
| C | 23 | Ctext1 |
| A | 12 | Atext3 |
| B | 0 | Btest1 |
+---+----+--------+
Then, I would like the spreadsheet to use the "main sheet" so that I see in another sheet:
+------------+----+--------+
| Category A | | |
| A | 18 | Atext1 |
| A | 5 | Atext2 |
| A | 12 | Atext3 |
| Category B | | |
| B | 0 | Btest1 |
| Category C | | |
| C | 23 | Ctext1 |
+------------+----+--------+
The only difficulty I have is to dynamically insert lines depending on how many As or Bs are in the main sheet.
Is there a function to do this easily (= without writing a script---I'd prefer to avoid going into this)?
AI: Inserting rows
No, spreadsheet functions cannot add or remove rows or columns. The two ways to perform these operations are: manually by the user, or by a script.
Alternative solution
That said, you can create an output of the desired kind with existing spreadsheet functions, without inserting new rows. My approach uses a helper column that can be subsequently hidden.
Cell Z1 of another sheet: =sort(unique(filter(main!A:A,len(main!A:A))))
This creates a sorted list of categories present in data. Column Z is a helper column and can be hidden.
Cell A1 of another sheet:
=array_constrain(sort({filter({"Category "&Z:Z, iferror(Y:Z/0), Z:Z}, len(Z:Z)); filter({main!A:C, main!A:A&" "}, len(main!A:A))}, 4, true), 1e6,3)
Explanation
The formula in A1 does several things:
filter({"Category "&Z:Z, iferror(Y:Z/0), Z:Z}, len(Z:Z)) creates a table where iferror is used to produce blank cells. It does not matter which columns are used in iferror (as long as there is no cyclic dependence), but the number must be one less than the number of columns in the input data. The result looks like this:
+------------+--+--+---+
| Category A | | | A |
| Category B | | | B |
| Category C | | | C |
+------------+--+--+---+
filter({main!A:C, main!A:A&" "}, len(main!A:A)) appends the original table, where the first column is repeated again as 4th, but with a space added to it. This 4th column is used for sorting only.
+------------+----+--------+----+
| Category A | | | A |
| Category B | | | B |
| Category C | | | C |
| A | 18 | Atext1 | A |
| A | 5 | Atext2 | A |
| C | 23 | Ctext1 | C |
| A | 12 | Atext3 | A |
| B | 0 | Btest1 | B |
+------------+----+--------+----+
Finally, sort(..., 4, true) sorts by the 4th column. The added space makes sure that items appear after categories.
The 4th column is then suppressed by array_constrain.
+------------+----+--------+
| Category A | | |
| A | 18 | Atext1 |
| A | 5 | Atext2 |
| A | 12 | Atext3 |
| Category B | | |
| B | 0 | Btest1 |
| Category C | | |
| C | 23 | Ctext1 |
+------------+----+--------+
Notation
If your locale uses commas as decimal separators, replace commas by semicolons in the list of arguments. But within the arrays {}, commas should be replaced by backslashes \. (Source: using arrays). |
H: How to automatically wrap text to new responses from a form in a Google Spreadsheet?
I had a working Google Spreadsheet where when new responses were filled in on the form, they would automatically get textwrapped on the Form Responses sheet.
Now recently I had to remake this spreadsheet and I just can't seem to figure out how to do that, automatically that is.
I know about 'paint format' and the textwrap button itself but I need it to do that automatically so I don't have to keep manually doing it myself.
I read about QUERY and ARRAYFORMULA but I can't get it to work.
AI: The only way I found to do this is with a script.
Step 1: Go to Tools > Script Editor and put the following code there:
function wrap(e) {
e.range.setWrap(true);
}
Step 2: Still in Script Editor, go to Resources > Current project's triggers, and select from dropdowns "wrap", "From spreadsheet", "On form submit".
NOTE: If under Resources you have no current project triggers - create a new one - name it "wrap" - then proceed to choose "From Spreadsheet", "On Form Submit" and it will work as stated.
Step 3: You're done. Close the Script Editor. The new form submissions will be automatically wrapped in the spreadsheet. |
H: Adding a Month to a Date in a Google Spreadsheet with a Script
I'm trying to create a Google App Script that adds one month to a date already on a Google Spreadsheet. In the example below I was trying to take the date from cell B2 (1/1/16) and add one month and then place the new date in cell B4 (2/1/16). Using the script below I get the result of 1454313600000 instead of 2/1/16. I haven't been able to figure out what I need to do to get a result of 2/1/16.
function myFunction(DateTest) {
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getSheetByName('Sheet1');
var value = sheet.getRange('B2').getValue();
var a1date = value.getMonth();
var newdate = value.setMonth(a1date+1);
sheet.getRange('B4').setValue(newdate);
}
AI: The issue here is on JavaScript level, not specific to Apps. The method setMonth that you use modifies the date object on which it's called. You don't need any assignment on that line. MDN docs don't even say what setMonth is supposed to return, but apparently it returns the millisecond timestamp corresponding to the new date. In any case, this is what works:
function myFunction() {
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getSheetByName('Sheet1');
var value = sheet.getRange('B2').getValue();
var a1date = value.getMonth();
value.setMonth((a1date+1) % 12); // no assignment needed; also, mod 12
sheet.getRange('B4').setValue(value);
}
Notice that % 12 is needed to get from December to January. |
H: How to remove hidden Google contacts
How can I remove people from the seemingly hidden contacts list Google keeps for me? For instance Google Play keeps showing me suggestions and reviews of apps from a person who is not in my contacts but who I emailed once or twice 4 years ago.
Similarly, in Gmail I get suggestions for email addresses I haven't had contact with for nearly 10 years, but I don't know how to remove these because they aren't listed in my contacts.
AI: At this point it's not possible.
Google Contacts has a suggested contacts features which doesn't have enable / disable option at this point.
So any time you email somebody Google contacts adds them as you suggested contacts so when you look at your contacts you see them as a contacts. Even the people you emailed once.
You can check Google Forums.
Also, these types of questions could be posted on Google Forums:
https://productforums.google.com/forum/#!forum/apps |
H: Disable desktop Facebook notifications
Recently I get Facebook notification such as friends' birthdays on my laptop with Windows 7 64-bit. (White rectangular box on the lower-right corner of the screen)
I'm using Chrome browser but don't have Facebook extension or something like that.
Why do I receive these notifications and how can I turn it off?
AI: This is likely part of the notification engine in Chrome which Facebook can be attached to.
While on the Facebook page, click the green SSL lock at the left end of the address bar and check to see if notifications are enabled for the site: |
H: Downloadable zip file in Blogger?
I am considering creating a blog in Blogger. I would like the blog to include a link to a zip file which would contain source code.
Two questions:
According to Sharing Files on Blogger, it was not possible to upload other than image and video files to Blogger when the question was answered, in 2013. As a workaround, one had to provide rar / zip file links for example through Dropbox. Is this still the case?
Suppose my Blogger blog includes a Dropbox link to the zip file. How can I monitor how many times the file is downloaded?
AI: 1 Yes. You need to provide links from a file-host. Possibly Google Drive can be used (I'm not 100% sure if Drive takes rar/zip files). But whatever file host you use, you need to get the link to the file from it, and put that link into your blog with the post editor or HTML-widget editor.
2 Monitor it using whatever tools your file host provides. Blogger provides only very minimal monitoring tools, for your post popular posts. It does allow Google Analytics to be set up for it. But even that cannot know if a file was downloaded from an external source. |
H: How does Google Drive bi-directional synchronization work?
I have my Google Drive synchronized with my computer folder (Google Drive) on windows PC.
What happens if I delete one file in my online Google Drive interface in browser?
What happens if I delete one file in my offline computer folder?
AI: What happens if I delete one file in my online Google Drive interface in browser?
The file will be moved to your Google Drive "Trash" folder and will be removed from your hard drive1.
What happens if I delete one file in my offline computer folder?
The file will be removed from your hard drive1 and will be moved to the "Trash" folder within Google Drive.
It works the same for Google Drive native files (Docs, Sheets, Slides) as well as other files. I confirmed this by creating four files: two Google Docs and two text files. I then deleted one of each from the Web, then one of each from my hard drive, and observed the results.
1 In both cases, it appears that the file will also be recoverable from your OS "Recycle Bin". This may vary for you depending on your local settings. |
H: Basic date manipulation in Google script
I would like to define a custom function in Google Sheet. This function should do something very simple, yet I have not managed to find how to do it. I am very confused with all the answers I read because I can't find a clear reference about dealing with dates in google scripts.
From what I understand, basic date manipulations can be done with:
new Date(): from what I understand, it defines a object which has some properties. I don't know how to use the date of a cell and convert it as such an object.
Utilities.formatDate(): this is to change the format of the date seen as a string.
the library Moment (http://momentjs.com/)
In the end, how can I input two dates (e.g. 31/01/2016) and, say, find the maximum between the two and extract the month of the first one?
function myfun(date1,date2) {
// month = month of date 1
// return maximum(date1,date2);
}
I am also interested if someone can explain the outlines of dealing with dates, or indicate a good reference.
AI: Getting and setting datetime values
Whenever your script calls .getValue() on a cell formatted as a date, date-time, or duration, it gets a JavaScript Date object. You can then apply various methods listed on that MDN page to this object, including getMonth() for the month. Example:
var sheet = SpreadsheetApp.getActiveSheet();
var value = sheet.getRange('A1').getValue(); // is a Date object
Logger.log([value.getMonth(), value.getHours(), value.getUTCHours()]);
// examples of available methods
Conversely, you can assign a Date object to a cell using setValue, and it will be automatically formatted as such.
sheet.getRange('B2').setValue(new Date()); // current timestamp
Timezones
The timestamp in Google Sheets is in local timezone, which is set via File > Spreadsheet settings. The script also operates within a timezone, which may be different and is found under File > Project properties in the script editor. If these timezones don't agree, you'll have a problem with timestamps.
To check whether the timezones agree, you can either compare both manually, or do something like this:
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getRange('A1').setFormula('=date(2015,1,1)');
Logger.log(sheet.getRange('A1').getValue().getHours());
This inputs the formula =date(2015,1,1) in the cell A1. The result will be 2015-01-01 00:00:00 in the spreadsheet's time zone. The script then gets the date and extracts hours in the local time of the script. If the timezones agree, you should see 0.0 in the log. |
H: Move all future appointments in Google Calendar
I have an appointment repeating every 4 days. After a certain period, I want to move all future appointment of that event one day. How can I do this?
Let me provide an example to be more clear.
1. 02/01/2016
2. 02/05/2016
3. 02/09/2016
4. 02/12/2016
5. 02/16/2016
6. 02/20/2016
Appointments 1-3 have the regular dates according to the defined schedule. From appointment 4 onwards, I want to move all appointments one day.
AI: Yes, you can do this...
Edit the event from which the day/date should change (ie. #4 02/12/2016 in the example)
Change the date (eg. advance by one day), change the repeat frequency, etc.
Click Save.
You then get prompted whether you want "to change only this event, or this and all future events in the series". Click Following events. Note, however, that "any changes [that have been made] to future events will be lost".
Note that this edited series of events are now considered a "new series of events". So, for example, if you went back to event #1 and decided to delete the lot, it would only delete #1, #2 and #3.
(This was tested on the web interface.) |
H: Importing SurveyMonkey survey into CognitoForms
Is it possible to export surveys from a SurveyMonkey account, and import them into a CognitoForms account? I wasn't able to find any info in the help pages of either service.
For my specific use case, here are my account types:
SurveyMonkey: SELECT Annual
CognitoForms: Team
AI: Cognito Forms currently supports automatic import of forms from Wufoo only.
https://www.cognitoforms.com/l/wufoo-alternative
We will consider other import tools in the future. The main reason we chose Wufoo first was their large presence in the market and lack of innovation since they were acquired by Survey Monkey. Also, the fact that 100% of Wufoo form features translated to Cognito Forms was a bonus too! |
H: Shape tag "" in draw.io. Where can I find any documentation?
Is there any place where I could find a documentation about the <shape> tag used in draw.io? I don't know nothing about it. Is it a kind of <svg> tag?
AI: It's documented in the user manual. |
H: How can I have a single calendar for all Trello cards?
I intend to use Trello for my personal new years bucket list task manager.
At a high level there are a number of goals (cards).
At the secondary level, I will have multiple cards associated with goals.
I also have calendar entry to to work on each goal (card) on daily basis.
Is it possible to see all my daily tasks/cards across multiple boards in a single Trello calendar?
AI: Sunrise Calendar, which was recently acquired by Microsoft, offers a Trello integration that allows you to aggregate cards with due dates on to a calendar.
You may need to install and configure the Trello integration via the Sunrise mobile app first, before having access to it on the desktop.
Once configured, you'll have the option of selecting My Cards or you can choose to select cards from specific boards.
If you use Google Chrome (Chromium), you can install the Sunrise Calendar Chrome App.
Caveats
The Sunrise Calendar app will no longer be updated as the app development focus has now shifted to Microsoft's Outlook product.
The Trello events that display on Sunrise Calendar default to 1 hour events. |
H: How do you export data?
When I go to entries and see the entire list of all my entries, there is an export button at the top. When I click the export button, nothing happens. I've tried with Firefox and Chrome. I can see the browser does a quick "loading" action when I click the button, but nothing attempts to download. I must be missing something simple.
AI: There was a temporary issue affecting export this evening. This has been resolved. Just click export (in any modern browser) and it should work just fine now. |
H: Referencing a range in a sheet with variable name in another cell
When I would like to import (query) many columns in another sheet I use this code:
=QUERY(sheet2!A1:D1;;)
Now I would like to make this formula a little dynamic making sheet2 variable. So I put the string sheet2 in a cell and make a reference to this cell using indirect(address());
=QUERY(indirect(address(row();column()-1)&"!A1:D1"))
But this did not work.
Example sheet
Please note: I know I could use
=query(indirect($A$1&"!A1:D1");;)
But I would the reference based on the position of the cell.
AI: Short answer
In the demo spreadsheet B2 cell, instead of address(row();column()-1) use A2 as an alternative replace the whole formula with =QUERY(INDIRECT(OFFSET(B2;0;-1)&"!A1:D1")).
Explanation
address(row();column()-1) returns "$A$2" not "sheet2". The quotes are used to indicate that the result is a string value, not a cell reference.
An alternative is to use OFFSET(B2;0;-1) in the B2 formula. This could be expressed in natural language as get the value of the cell to the left of this cell (the cell that contains the formula).
The final formula is
=QUERY(INDIRECT(OFFSET(B2;0;-1)&"!A1:D1"))
OFFSET()
From OFFSET()
Syntax
OFFSET(cell_reference, offset_rows, offset_columns, [height], [width])
cell_reference - The starting point from which to count the offset
rows and columns.
offset_rows - The number of rows to shift by.
offset_rows must be an integer, but may be negative. If a decimal
value is provided, the decimal part will be truncated.
offset_columns - The number of columns to shift by.
offset_columns must be an integer, but may be negative. If a decimal
value is provided, the decimal part will be truncated. height - [
OPTIONAL ] - The height of the range to return starting at the offset
target.
height is ignored unless OFFSET is used in an array formula. width - [
OPTIONAL ] - The width of the range to return starting at the offset
target.
width is ignored unless OFFSET is used in an array formula.
Remarks
Instead of QUERY(range_reference) to import a range of cells to another sheet use the array notation:
={sheet2!A1:D1} or
={INDIRECT(OFFSET(B2;0;-1)&"!A1:D1")}
Demo
Example is presented to show that both approach, using QUERY() and using array notation, return the same result.
Note: The image shows comma as the parameter separator due to the default regional settings of the file.
References
Using arrays in Google Sheets - Google Docs editors Help |
H: How to forward a bunch of old Gmail emails?
I tried to create a filter to forward in Gmail and selected the Also apply filter to 37 matching conversations. However, it did not work and the dialog does warn:
Learn more
Note: old mail will not be forwarded
Clicking Learn more shows in part:
Please note: When you create a filter to forward messages, only new messages will be affected. Any existing messages that the filter applies to will not be forwarded.
Therefore, how can I programmatically cause the 37 emails I'm interested in forwarding to be forwarded without manually sending each one individually in Gmail?
I see this one solution using Google Docs, but it seems pretty complicated to forward my 37 emails, I think manually doing it would be faster than this solution.
AI: There really isn't a simple solution. For 37 messages, I'd almost certainly just do them one at a time. It couldn't possibly take more than a half hour.
One other option might be to use Google Takeout to download all the mail messages with a certain label. The messages will be in MBOX format, and many email clients can import that without issue. |
H: Forms Data Manipulation In Google Sheets
I'm trying to develop a solution using Google Forms with Google Sheets that will collect Google Forms data and then automatically divide that one form submission's data into multiple rows of data in another sheet.
I've learned how to QUERY data (thanks to many of you on here) from one sheet to another, but I don't know how to automatically divide 1 row of data into multiple rows.
Here is a YouTube video outlining the problem in a visual manner (I will not delete it).
Basically, I have one Google form that collects the following.
Teacher Information (header data)
Report Name (header data)
Class Information (header data)
Student#1 Data (record data: Multiple Form Fields)
Student#2 Data (record data: Multiple Form Fields)
Student#3 Data (record data: Multiple Form Fields)
Student#4 Data (record data: Multiple Form Fields)
Student#5 Data (record data: Multiple Form Fields)
I need an automated way to convert that single form response (1 row) into multiple rows (5 rows) each with the same 'header data' but with unique record date.
EXAMPLE Form Data
Header Data - Record Date (Student #1) - Record Date (Student #2) - Record Date (Student #3) - Record Date (Student #4) - Record Date (Student #5)
EXAMPLE Desired Manipulated Data
Header Data - Record Date (Student #1)
Header Data - Record Date (Student #2)
Header Data - Record Date (Student #3)
Header Data - Record Date (Student #4)
Header Data - Record Date (Student #5)
AI: Short answer
Add a new sheet.
Add the following formulas to the new sheet
Cell A2 -> Headers
=OFFSET('Form responses 1'!$A$2,ceiling((row()-1)/5,1)-1,0)
This could be repeated several times, one for each header column, just change the last parameter accordingly.
Cell B2 -> data
=OFFSET('Form responses 1'!$A$2,ceiling((row()-1)/5,1)-1,mod(row()-2,5)*2+1,1,2)
Fill down as necessary
Explanation
OFFSET() is used to get the values from the source data.
'Form responses 1'!$A$2 is the start point to count columns and rows.
row() is used to increment the row and column iterators.
ceiling((row()-1)/5,1), row iterator, is used to set the row from the source data.
mod(row()-2,5)*2+1, column iterator, is used to set the column from the source data.
In the data formula the last parameter, indicates the number of data columns.
In case that are several "header data" columns, add 1 for each of them. I.E. if there are five "header data" columns, and six "data columns" the column iterator should be
mod(row()-2,5)*6+5
The final data formula to be added to the F2 cell is:
=OFFSET('Form responses 1'!$A$2,ceiling((row()-1)/5,1)-1,mod(row()-2,5)*6+5,1,6)
In the row and column iterators, 5 is used because there are 5 columns for "record data".
Demo
Spreadsheet |
H: Hide Friends and Activity on Facebook
On Facebook, I am trying to hide my friends from seeing who I am friends with and who I add as friends. I have already set "who can see my friends" to only myself and I have unchecked all boxes in my activity log for friends. Yet, even when I have unchecked all boxes, it still appears in my activity log and it also has the pencil tool next to it saying "allowed on timeline". What is happening here? I have no way of knowing what other people see. How can I ensure that no one can see my friends or anything along those lines. I do know that mutual friends will be shown, but I'm not worried about that.
AI: You have already hidden it. So don't worry. It is visible to you only. No one can see these section now.
In normal case, when you click on pencil symbol you will see two options "Allowed on Timeline" and "Hidden from Timeline". You have already hidden this. So it is showing "allowed on timeline" option, and it will be visible to you only. |
H: Send recurring reminders to Google Form respondents
I need to create a Google form like below :
My objective is to send an reminder of Activity Described in < Your Activity > Question
Then I need to send reminder email to email mentioned in < Email > Question, With Selected Frequency in < Frequency > Question i.e. recurring reminders !
I searched for examples and add-ons but haven't got anything. I think I can program it with someone's kind guidance.
AI: You can do a lot of things with Google Forms responses with basic programming skills and knowing JavaScript as ome tasks with Google Forms responses could be automated with Google Apps Script with a bounded script to the form.
One of the keys for your project is to use Google Apps Script installable triggers, specifically time-driven triggers to be able to do automate recurring tasks like sending recurring reminders.
References
Extend Google Docs, Sheets, and Forms with Apps Script - Google Docs editors Help
Sending Confirmation Emails from Google Apps Forms |
H: Filter multiple values using filter by condition tool in Google Spreadsheet
I'm trying to filter a long list of URLs to narrow down which ones I'm interested in. I've got my URL list in Google Spreadsheet and I'm using the filter tool to remove data that I don't want.
At the moment using the filter setting: Filter by condition, text does not contain.
This works fine but so far I've only been able to set input 1 value in there. I.e. pinterest
What I want to do is put multiple values into that box IE. "pinterest" OR "facebook" OR "twitter" or something like pinterest, facebook, twitter. Like the image below (although if I run this it doesn't filter at all.. any ideas?
I've created a shared spreadsheet here to test in
AI: You can filter using a regular expression. Use the options Filter by condition > Custom formula is...
=not(regexmatch(N:N, "(?i)facebook|pinterest|twitter"))
to see only the strings that do not contain one of the above.
Here N is the column you're filtering, and the regular expression means: the string contains match one of words facebook, pinterest, twitter, case-insensitive. And not is the negation of that. |
H: Inline paragraph in Trello comment
How can I insert an inline paragraph in Trello comments like the screenshot below?
AI: The screenshot actually shows a code block
Code block - Include formatted code by wrapping it in three backticks (```) at the beginning and end of the block, or by starting a line with four spaces. Note that the triple backticks have to be on a separate line and ensure you have a blank line before and after the code block.
Inline code - Include inline formatted code by wrapping it in a single backtick (`) at the beginning and end of the code.
You can find more on styling here: http://help.trello.com/article/821-using-markdown-in-trello
Apart from that, comments are always displayed chronologically |
H: Complex views in embedded Google Sheets
I have a Google Sheets contact list for a multicampus boarding school. The sheet at present summarizes the contact info for each person into the first 4 cells of the row. Entry is made using the rest of the columns. This overall makes editing and sorting far easier.
The kind of thing I would like to do:
A: Only the summary columns are visible.
B: No user can edit data in the embedded web page version.
C: Users can sort and filter on columns that they cannot see.
For example, the first summary column contains this:
Juan Francisco Alvarez
2140 AG01
Decoded, besides the name, it says that he had laundry number 2140, he was last at the Anytown campus in 2001, and that he graduated.
I want users to be able to do things like:
Show me all the grads of O1, sorted by laundry number. (Students that started the same year as Juan will all be in a consecutive block of laundry numbers)
So for this I want to sort by laundry number, without laundry number being a visible column.
Show me all the students who may have overlapped with me (class of 96 to 2006) and who have last known addresses in British Columbia.
I want to sort by cohort year (the year they would have graduated, had they finished) filter by 96 to 2006, filter by the presence of BC in the City/Prov column.
Who has died? (There is a Deceased in Notes for these)
Hide the other campuses. I'm only interested in Mudville (M)
So far in named views I seem to be able to filter or sort on one thing, and one thing only.
Link to sample sheet
AI: You need to write a script and publish it as a Web app.
You can't do that with just Google Sheets. Requirement (C) requires custom script. Unfortunately, for the viewers to use the script, you need to grant them full edit permission, which contradict your requirement (B). |
H: How to receive a notification when changes are made to a specific tab in Google Sheets?
If would like to receive an email notification if a new row is added to a specific tab in a Google Sheets.
The default notification rule settings are too limited and the Google Sheets Add-on Store does not provide any suitable add-on script:
How to send such notifications with a Google Apps script?
AI: The event object helps here, specifically its changeType property, which tells the script what kind of change happened. If this change is INSERT_ROW, and the name of sheet matches the one you want, then an email is sent using MailApp.
function notify(e) {
var sheet = SpreadsheetApp.getActiveSheet();
if (sheet.getName() == 'Tracked Sheet' && e.changeType == 'INSERT_ROW') {
MailApp.sendEmail('myemail@gmail.com', 'Row Added', 'A row was added to your sheet.');
}
}
To use this, add a trigger (Resources > Current project's triggers) with the properties "From spreadsheet | On Change". |
H: False-positive Google search results that come from inner website search tool
I would like to know if there exists a name and maybe explanation for a phenomenon described below:
I type into Google (or other search engine) words "chicken quick recipes".
I click the first result I get, because it seems promising. It comes from PortalA.
The webpage I see is not a page with a certain recipe but is a PortalA's inner search engine result list -- at the top of the webpage I see a search bar with words "chicken quick recipes" rewritten. The articles found by the inner search engine are not relevant to what I want, for example one article is on "quick recipes" and other on "chicken" (the words appear in the short summaries of the articles and you can click on links to them).
Of course I somewhat understand how Google works, that I will not always get what I want, and that it might be hard to distinguish that the terms come from different article summaries when it indexes the pages.
But I used not to have such problems, so I wonder if there is a special technique exercised by such portals involved, especially that search engine results seem rather a dynamic page, so how they get indexed at all? Does Google crawler input different search strings into such pages and index resulting pages, it does not seem right?
AI: This type of thing, where 3rd party search results get indexed, is something that Google actively tries to avoid. Since, as you have found, it gives a bad user experience.
It's not really a "false-positive", since it is a page containing the keywords/phrase that you searched for. It's just a low quality result and not really what you had in mind. In the case of your example, you might get better results if you search for the exact phrase ie. "chicken quick recipes" (including the quotes).
Any decent webmaster should block their own search results pages from being crawled by the search engines. In fact, on many sites, the indexing of search pages can have a detrimental effect on the site's SEO and general server load.
However, sites do make mistakes and some sites, particularly those scraping/aggregating 3rd party content might simply be trying to make a fast buck by spamdexing - blackhat SEO.
...so how they get indexed at all?
Quite possibly by finding links and crawling them. The site in question might be generating 1000's of links for various search phrases and these are then crawled and followed.
Does Google crawler input different search strings
It's quite possible that Google will complete and submit HTML forms - to see what happens. However, I don't think Google will index recognisable search pages using this method. The link method, mentioned above, is more probable. |
H: How to convert or parse Olson timestamp?
How do you convert 2016-03-05T08:30:00 to time in Google Spreadsheets?
I would like to convert it to "hh:mm:ss".
AI: Short answer
Assuming that the value is in A1. Use
=TIMEVALUE(Right(A1,8))
then apply the desired time format to the cell.
Explanation
Google Sheets handles date, time and duration data as serial numbers. In several cases, this makes easy to do certain calculations that involves this kind of data. In some circumstances, functions like TIMEVALUE could display a number instead of a time in the desired format but this could be solved by applying the desired format.
To apply hh:mm:ss as the number format, click on Formats or the button o the Google Sheets toolbar, then click on the following path:
Number > More formats > More date and time formats
A dialog like the following will be displayed:
Click on the drop-down button to select a handler. Then click on the up/down arrows to select the desired format. |
H: Can I signup with Facebook with custom domain email?
I am trying to use my site mail to signup with Facebook, like myname@example.com, but Facebook is reporting it as invalid mail. So, are we not allowed to use anything other than Gmail, Yahoo etc.?
AI: This should be possible, however it could be that your email domain is flagged somehow as unreliable. This doesn't per se mean that it flagged yours specifically but the algorithm they use nonetheless did so anyway.
It could also be the following: https://www.facebook.com/help/community/question/?id=3956397517776
They asked the same question here and the problem is maybe that emails containing words like info or mail like info@example.com are not personal enough. |
H: How can I invite people to add a marker to a map created with Google Maps My Maps?
Background:
I am looking into the ways of inviting people to add markers to a map that I created using My Maps of Google Maps. I know that I can share the link to the map with editing rights but ideally I would want people to fill in a form to provide all details which are then automatically added to the map on form submission.
Is this possible with Google Maps?
AI: I have not heard of Maps offering Forms like that.
You could build a solution using a Google Form, and a script that edits the map when the form is submitted. |
H: Prevent YouTube related videos
Is it possible to stop the related videos from showing after videos? The problem is YouTube freezes for a short period of time after the video ends, I guess because of the related video loading time. This gets extremely annoying, so I usually try to stop them before they end. I searched for an Extension, but couldn't find any.
p.s., This is for YouTube videos in general, I don't need it for my uploaded embed videos!
AI: I use the following extension which prevents related videos showing at the end of the current video, as well as many other things, which I quite like:
Magic Actions for Youtube
Please not I am not affiliated with the extension in any way, I am just a user.
I expect it is the "Auto-hide player controls" option which creates this behaviour, accessible from the options cog underneath the video once the extension is installed.
Happy watching! |
H: Change text in one cell by removing the parts entered in other cells
I want to know if there is a way to add multiple numbers with letters to one cell and each number/ letter get eliminated when that number gets placed in another cell.
For example:
cell b4 has: 4, 7, 8, 5H
I put "5H" into any cell of E4:H4
resulting in 5H being removed from cell b4 leaving just 4, 7, 8
I would like to be able to do this with any one, any multiple, or all the numbers in cell 5H to be removed when their numbers are entered into any of the cells of e4:h4.
Here is a copy of the Spreadsheet
https://docs.google.com/spreadsheets/d/11uvHy49n0i-Yj905wm4B2d_M9THHp16hS5jTrgYvPu8/edit?usp=sharing
AI: One can't have both data and a formula in the same cell. If you want B4 to change in response to changes elsewhere (and don't want to write a script), then B4 must contain a formula. Then the data (such as "4, 7, 8, 5H") must be elsewhere. In my example, the data is in A4 but it could be any cell. Here is the formula for B4:
=join(", ", split(regexreplace(A4, iferror("(?i)\b("&join("|", filter(E4:H4, len(E4:H4)))&")\b", ""), ""), ", "))
Explanation:
iferror(join("|", filter(E4:H4, len(E4:H4))), "") joins nonempty cells in the range E4:H4 into a regular expression such as 7|abc|5H
The regex is wrapped in word boundaries: \b(7|abc|5H)\b, so that 7 does not get removed from 7H, for example.
It is made case-insensitive with the flag (?i), so that 2h is treated the same as 2H.
regexreplace replaces the above with empty strings
The split-join operation takes care of empty places left after replacement. For example, if regexreplace produced 4, 7, , 5H then split-join will make it 4, 7, 5H. |
H: How to recover Gmail draft
I was working on an important email in Gmail over several days, on both my iPad and computer.
When I look for it now, it's not there. I DID NOT DISCARD THE DRAFT.
It's not anywhere in Gmail, not in trash, not in drafts.
How can I recover this email?
AI: There are a couple of circumstances that could allow users to recover a discarded draft message in Gmail
The "Undo discard" link is still shown in the Gmail web app. Click it before it disappears!
The user has a device that is not synced yet that has a copy of the draft.
If none of the above circumstances occurs, then is not possible to recover a discarded draft message in Gmail.
There are a lot of posts about this in the Gmail Help Forum: recover drafts |
H: Automatically record daily values in a new column
So I have this spreadsheet I use to control Content funnel.
I've come up with a few formulas to use something else than a pivot table.
But in order to get the trends and alarms I'm looking for, I need to start recording this data daily.. automatically.
This is the spreadsheet:
I'm looking for a script that would add a column between columns B and C, setting current date in cell C1, and completing each cell below with the corresponding value to each formula in each cell.
Here's the list of forumlas I'm using:
C2: =counta(Check!$J:$J)
C3: =COUNTIF(Check!$L:$L,Validation!$A$6)
C4: =COUNTIF(Check!$L:$L,Validation!$A$7)
C5: =ARRAYFORMULA(countif(Check!$L:$L&Check!$O:$O,Validation!$A$5&"") )
C6: =countif(Check!$O:$O,Validation!$A$1)
C7: =ARRAYFORMULA(countif(Check!L:L&Check!O:O,Validation!A5&Validation!A2) )
C8: =ARRAYFORMULA(countif(Check!O:O&Check!Q:Q,Validation!A1&"") )
C9: =countif(Check!Q:Q,Validation!A1)
C10: =countif(Check!Q:Q,Validation!A2)
C11: =countif(Check!T:T,Validation!A1)
So far I've only achieved this much:
function recordHistory() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Approval Funnel");
var source = sheet.getRange("C2:C11");
var values = source.getValues();
values[0][0] = new Date();
sheet.insertColumns(3);
And that's the frontier of my coding knowledge.
Any ideas?
AI: Your draft is pretty good, but there is a design flaw: if you insert the values between B and C, then the column with formulas will become D. So, next time the script will try to get data, it will be looking at a wrong place.
Simply put, the source of the data you are recording (i.e., the column with formulas) should stay in the same place. You can put the historical data to the right of it. Like this:
function recordHistory() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Approval Funnel");
var source = sheet.getRange("C2:C11");
var values = source.getValues();
values = [[new Date()]].concat(values); // prepending the date to values
sheet.insertColumnAfter(3); // inserting AFTER column C
SpreadsheetApp.flush();
sheet.getRange("D1:D11").setValues(values);
}
I put SpreadsheetApp.flush(); to make sure that the previous changes (namely, inserting a column) is indeed made before the script puts the data in with setValues.
Also you had an error in values[0][0] = new Date(); -- this command would overwrite the 0th element of array (namely, the content of C2) with the date. You wanted to prepend the date, which is what I did by creating a new array with one element, [[new Date()]], and concatenating values to it. |
H: Custom Google Spreadsheets shortcuts: move selected row(s) Up/Down/Top/End
As the title says, I do move rows a lot and the lack of default shortcut complicates things for me...
The drag option isn't practical when I need to move some rows to the bottom of a huge sheet!
I tried to us AutoHotKey, but it's a pain since it move one row at a time and takes ages to reach the bottom.
So I'm looking maybe for a JavaScript solution, maybe if someone could put me on the right path with a base example code/references that I could edit/extend later to suit my needs...
Also, any alternative solution I'm not thinking of is welcome.
Edit:
From the title:
Up: move row(s) one row up
Down: move row(s) one row down
Top: move row(s) to the top of the sheet (all the way up)
End: move row(s) to the bottom of the sheet (all the way down, at the end of non-empty rows)
AI: The following script moves selected consecutive rows in one of four ways described in the question. It is triggered by custom menu items (Custom > Move rows...) which is created by onOpen function whenever the spreadsheet is opened. Unfortunately, there is no way to assign keyboard shortcuts to script functions.
The structure of functions is simple: insert rows, copy the range (including formulas and formatting), delete old copy of the range. The helper function getData eliminates the need to repeat the same data-gathering in each of four functions.
function onOpen() {
var menu = [{name: "Move rows up", functionName: "moveUp"}, {name: "Move rows down", functionName: "moveDown"}, {name: "Move rows to top", functionName: "moveTop"}, {name: "Move rows to bottom", functionName: "moveBottom"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu("Custom", menu);
}
function moveDown(){
var d = getData();
d.sheet.insertRowsAfter(d.row+d.height, d.height);
d.selection.copyTo(d.sheet.getRange(d.row+d.height+1, 1, d.height, d.width));
d.sheet.deleteRows(d.row, d.height);
}
function moveBottom(){
var d = getData();
d.sheet.insertRowsAfter(d.last, d.height);
d.selection.copyTo(d.sheet.getRange(d.last+1, 1, d.height, d.width));
d.sheet.deleteRows(d.row, d.height);
}
function moveUp(){
var d = getData();
d.sheet.insertRowsBefore(d.row-1, d.height);
d.sheet.getRange(d.row+d.height, 1, d.height, d.width).copyTo(d.sheet.getRange(d.row-1, 1, d.height, d.width));
d.sheet.deleteRows(d.row+d.height, d.height);
}
function moveTop(){
var d = getData();
d.sheet.insertRowsBefore(1, d.height);
d.sheet.getRange(d.row+d.height, 1, d.height, d.width).copyTo(d.sheet.getRange(1, 1, d.height, d.width));
d.sheet.deleteRows(d.row+d.height, d.height);
}
function getData() {
var d = {};
d.sheet = SpreadsheetApp.getActiveSheet();
d.selection = d.sheet.getActiveRange();
d.row = d.selection.getRowIndex();
d.height = d.selection.getHeight();
d.width = d.selection.getWidth();
d.last = d.sheet.getLastRow();
return d;
} |
H: How do I calculate the sum of 2 columns using the max from each row based on a condition?
I have data in two columns. I would like to sum the two columns (A and B) based on the max value in each row and a condition (c) indicating if the row should be included in the sum. Example:
A B C
1 4 No
2 3 Yes
3 2 Yes
2 1 Yes
1 0 Yes
The result would be 3+3+2+1=9. Data is the first row should not be included because the condition in column C states "No".
I have been able to sum the values using the arrayformula below but have not been able to figure out how to add the condition.
=ARRAYFORMULA(SUM(IF(A1:A>B1:B,A1:A,B1:B)))
I am using Google Spreadsheets.
AI: In your particular example, you can use a SUMPRODUCT formula.
=SUMPRODUCT((A1:A5*(A1:A5>=B1:B5)*(C1:C5="Yes"))+(B1:B5*(B1:B5>A1:A5)*(C1:C5="Yes")))
This approach may be clumsy in your real world example, though. If your real data is more complicated, post a snippet that shows that complication and I can take a more advanced crack at it. |
H: Lock the formula of a cell, even if the cells it references change
I have this, in D1:
=sum(D3:D)
I want D1 to always be the sum of the rest of column D (D2 is a header)
I sometimes move a row, from eg 8 to 3, and that causes D1 to change to sum(d4:d).
I want D1 to stay as my sum of the column.
AI: Short answer
Use =SUM(INDIRECT("D2:D"))
Explanation
Google Sheets will update A1 notation references when rows or columns are inserted, so if you need that a reference never changes, instead you have to use a string and the INDIRECT() function to convert it to a reference.
References
INDIRECT - Google Docs editors Help |
H: Conditional formatting "is equal to" value in referenced cell
What do I add to the text field directly below the "is equal to" selection if I want the test to be the value of a specific cell?
I want the condition to pass and format a cell "IF" it is equal to the value in cell E1.
I've tried =E1 and E1, but they're not working.
I know this is a simple one and I'm just missing something basic, but I can't figure it out and I've looked around.
AI: You need =E$1 there. (Or, =$E$1 if the formatted range spans multiple columns.)
Putting E1 would compare cells to the string "E1", which is not what you want.
Putting =E1 compares the first cell in your column range to E1, the second to E2, the third to E3, etc -- because the reference is relative. The dollar sign makes it an absolute reference. |
H: How to change the language setting of a Google Doc?
In Google Docs, I imported a Word document and converted it to a Google doc. The spell checker didn't recognize English words such as "Monday" and "February". I assume that the document isn't using English for the spell checker language.
How can this setting be changed in a Google Document?
It wasn't using local language settings. Maybe because it started life as a Word doc (speculation). If I go into the setting and change it to Francais (French), spell check complains about "Monday". Change it back back to English, spell check doesn't complain about "Monday". So the Language setting affects spell check.
AI: As of this writing, to change the Language setting of a Google Doc, go to File > Language. In that menu, you can select a language such as "English (United States)" to get the spell checker to recognize English words. |
H: Draw.io Table Background Color
How do I change the background color of one cell or one row of a table?
I can only seem to change the background color of the entire table in draw.io yet shapes exist that have some of he other cells colored differently?
I'm just trying to get a shape with a table that has a heading with a different background color so if there's any other way to do this that would be helpful as well.
AI: It's a pain.
If you double-click the table to enter 'edit mode', you view the HTML for the table, by clicking the HTML button in the top toolbar. (This is only visible when editing an entity.) The table styles are done inline. And the HTML is unformatted so it all just shows up on one line.
For example, if you use the 'green' table in the 'Misc' panel, you can search for:
<tr style="background-color: #eaf2d3 ; border: 1px solid #98bf21">
and change the color to what ever you want. But this only changes that specific row.
If your using Draw.io online, you can at least take advantage of the browser's native search in page function ('CMD+F' or 'CTL+F') to find and replace the color string.
I havn't figured out to search with the desktop/chromeapp version.
Edit: After playing around a bit, I found it was much easier to build your own table just using a group of rectangles.
After arranging the rectangles with correct height and width, group them. 'Arrange -> Group' or 'CTL+G'. The group allows the table to be moved around as one object, instead of individual entities.
You can then select Rows or Columns just by dragging a selection rectangle. You can tab through all the fields, and just start typing.
It's much easier than trying to use the pre-built examples. |
H: Is it possible to 'reset' the value of a cell in one sheet from another sheet?
I have two separate google sheets (GlobalReport & IndividualReport). Both share information between each-other, but I need to be able to "reset" a cell value in the IndividualReport sheet.
Cell L7 on the IndividualReport sheet is validated (see screenshot) from a range of values form another sheet within the workbook. There are four options to choose from (one is 'no'). I need to be able to "reset" that value to 'No' at random times from the GlobalReport sheet.
I'm currently using =importrange("1Cm0tAGlobalReportSheet", "lists!A1:A30") to populate the validation list.
Is possible to update IndividualReport L7 using some kind of trigger? If yes, any help would be greatly appreciate.
AI: Since the content of L7 is going to be overwritten, spreadsheet formulas cannot perform such reset. You need a script that has the spreadsheet keys of all the spreadsheets to be changed, and has the authority to edit them (i.e., the Google account under which it runs has this authority). It can be either a stand-alone script, or bound to your master spreadsheet, whichever is more convenient. Also, you'll need to know the name of the sheet within the spreadsheet in which the cell L7 is located; apparently it's "FailingStudents".
function reset() {
var keys = ['....', '....' ]; // list of spreadsheet ids
for (var i = 0; i < keys.length; i++) {
var ss = SpreadsheetApp.openById(keys[i]);
var sheet = ss.getSheetByName('FailingStudents');
sheet.getRange('L7').setValue('No');
}
}
Once you run this, the cell FailingStudents!L7 will be set to No in all listed spreadsheets. |
H: How to include multiple IF statements in one cell in Google Sheets
I am attempting to change the value of a cell in Google Sheets based on the value of an adjacent cell. This adjacent cell gets its value from the colour of the cell adjacent to it using the formula from this Quora answer. So the value of the cell should change based on the hex code which is obtained from the colour of the first cell. There are four possible hex values at the moment so I was trying to put four different IF statements in the same cell, so its value is changed based on this.
My first attempt led to a formula parse error:
=if((J2="#00ff00","Read"), if(j2="#ff0000", "Unread"), if(j2="#ff9900","In Progress"), if(j2="#000000", "Not Applicable"))
It is clear you cannot simply separate if statements with commas. Based on this Stack Overflow question I tried this code, with nested IF statements:
=if((J2="#00ff00","Read", if(j2="#ff0000", "Unread", if(j2="#ff9900","In Progress",if(j2="#000000", "Not Applicable")))))
This also leads to a formula parse error.
Is there any way I can simply include multiple IF statements in the same cell which will work for my code?
AI: Use lookup instead of if:
=lookup(B7,
{"#000000","#00ff00","#ff0000","#ff9900"},
{"Not applicable", "Read","Unread","In Progress"}
)
Note the second parameter must be a sorted list. |
H: Copying data to another sheet based on the month of a date
I hope someone can assist me in looking in the right direction.
I have a sheet (Master) which has rows of data regarding different types of projects and deliverables.
One column in this sheet has a date value under column header "closingDate". The deliverable dates extend through the year. For example. we may create an entry today in the Master, for a project that is due to close in September of next year.
We need to be able to see what are the deliverables for a particular month. The years don't matter. All projects closing in Jan 2016, 2017, 2018, etc.
For reasons that I can not state we can't use filter or filter views in the Master Sheet.
An ideal solution for us would be to have sheets named Jan, Feb, March, April, etc.
Each time a record is added to the Master, depending upon the month of the closingDate a copy of the record is made in the sheet named after the month. Each time the record is edited in the master sheet the corresponding record is also updated.
I know I need a script, but being new to Sheets, I would greatly appreciate someone who could point me in the right direction.
AI: You don't need a script: the Filter command (which is different from filters and filter views) does this easily.
Suppose your master sheet is named Master and the closing date is in column B. Then in Sheet "Jan" you would enter
=filter(Master!A:Z, month(Master!B:B) = 1)
Here A:Z are the columns of Master sheet (of course there may be more, you can use A:ZZ, etc). The condition that month of the date in column B is equal to 1 means it's January.
In the sheet named "Feb" you would put
=filter(Master!A:Z, month(Master!B:B) = 2)
and so on. The edits to Master sheet will be immediately reflected in the month sheets. |
H: Can I configure Google to favour fresh publications and/or use particular time frame by default?
I have found myself clicking Search tools - Past year / Past month too often, in the majority of the cases when I search I am looking for fresh publications as information gets obsolete quickly in my area of interest. So, I would like to see new posts first usually. Can I pre-configure this?
AI: Doesn't appear to be an option in preferences.
You can bookmark this URL to search the past month
https://www.google.com/webhp?tbs=qdr:m
You can bookmark this URL to search the past year
https://www.google.com/webhp?tbs=qdr:y |
H: Cannot link to an image from Blogger to Google Drive
I have a simple PNG image on my Google Drive. How can I create a link from a Blogger blog to that image?
Here is what I tried:
In Google Drive, I changed the settings of my PNG file to "Anyone on the internet can find and view".
In Google Drive, I copied the URL of by PNG file https://drive.google.com/file/d/0B-NH9wCC0oM4U2x2WTZ3ZkJ1a1k/view?usp=sharing).
In my blog's HTML, I added a link to the URL copied in step 2, like this:
<img alt="https://drive.google.com/file/d/0B-NH9wCC0oM4U2x2WTZ3ZkJ1a1k/view?usp=sharing" src="https://drive.google.com/file/d/0B-NH9wCC0oM4U2x2WTZ3ZkJ1a1k/view?usp=sharing" />
When I open the blog, the link does not show up as a PNG image, but as a link ("https://drive.google.com/file/d/0B-NH9wCC0oM4U2x2WTZ3ZkJ1a1k/view?usp=sharing").
I tried with Chrome and Firefox, but same result.
What am I doing wrong?
AI: That is the link to the Google Drive image viewer, rather than a link to the image itself. If you check the URL for the image when you visit that link, you get an URL like:
blob:https%3A//drive.google.com/32efcf38-d7e6-4656-9046-eede4c4880f9
That's not useful. You need to do a little URL manipulation of your original URL to be able to hotlink it. You need to take your original URL, which looks like this:
https://drive.google.com/file/d/{file-id}/view?usp=sharing
And change it to this:
https://drive.google.com/uc?export=view&id={file-id}
So, in your specific case:
https://drive.google.com/uc?export=view&id=0B-NH9wCC0oM4U2x2WTZ3ZkJ1a1k
And now you should be able to see your image:
Of course, the "sharing" setting for the image must be set to "public on the web". (Which you've already done.)
This URL manipulation is completely undocumented in the Google Support documentation. As such, you are duly warned that this method may stop working. You might want to find a more stable image storage solution. Imgur is purpose-built for this sort of thing, but there are plenty of other alternatives.
Credit where credit is due: I found this solution on the Google Operating System blog, which in turn found it at this question on Stack Overflow: Displaying files (e.g. images) stored in Google Drive on a website. |
H: Create filter on Gmail for BCC to myself
I run a startup and we send quite a lot of emails. I've started to BCC these emails that my software sends to myself as an alias. For example:
layke@example.com might be my main email and I'm now sending them to
layke+blind@example.com as a bcc to field, (in addition to the clients email as the main "to" field).
The problem is that I can't seem to create a filter for these emails in my Inbox. I want to archive them immediately, but it doesn't appear as though there is a way to do this.
If I search for emails, I can't see them. I guess this is because Gmail doesn't store the BCC field (even if it's sent to you).
Headers of email:
I think my only option is to create a fully fledged inbox JUST for these BCC's as I can't find any way to identify and label them.
AI: You need to filter on the delivered-to header.
Fortunately, Gmail allows you to do that.
Use the advanced search flag in the "has the words" field for your filter. For example:
deliveredto:layke+blind@example.com
You can probably even shorten it to
deliveredto:blind
but you may get too many false positives.
I have a few similar filters for just this purpose. |
H: How to recover a message mistakenly identified as spam by Inbox?
I found a non-spam message that was automatically placed in spam folder (a false positive). In the Gmail interface, I would click "Not spam" to remove the message from spam folder. But I could not find any such action in the Inbox interface.
How can I tell Inbox that this message (a) was not spam, and (b) should not be deleted in 30 days?
AI: Remove from Spam
Open the email you found in Spam.
Select Pin .
Your message will move back to your inbox. You can quickly find it again by clicking the switch at the top of the inbox .
Source. |
H: How do I disable comments globally on a Google Site?
In Google Sites, I can disable comments for a page by clicking Settings, Page Settings, and unchecking "Allow comments". How do I uncheck this option for all pages at once, i.e. disable comments globally on my site? Do I need to disable comments on a per-page basis?
AI: Short answer
There isn't a global setting for comments in Google Sites, so the comments should be disabled page by page.
Extended answer
You could disable the comments option page by page manually. Unfortunately looks that there isn't a method to do this automatically by using Google Apps Script.
To avoid this problem in the future, create a page template with the comments option disabled then use it to create the new pages.
References
Sites Service Overview - Google Apps Script
Disable comments when creating a page from script (Google Apps Script) |
H: How is Google reducing file size of my backed up photos when image stats are unchanged?
I have my Nexus5 set up to automatically back up my images to Google photos. On my phone there are 2 options for backing up photos:
High quality
Great visual quality at reduced file size (free unlimited storage)
Original
Full resolution that counts against your quota
I am currently using the High quality setting.
I decided to perform a spot check of a photo on my phone vs. the same photo online:
Phone - file size 1.71MB
Online - file size 1.18MB
Then I compared the stats of the photos in Windows explorer - both are identical:
How is Google reducing the file size for the backed up photo?
AI: Google will be resampling the image using a higher level of compression (which your stats don't show). The quality of the image is likely to decrease slightly, although whether this is noticeable to most people is another matter.
The "quality" (a scale of 1 lowest to 100 highest) factor is part of the JPEG algorithm. Reducing the "quality" increases the effective compression. Applied intelligently, small reductions in the "quality" (at the upper end) can result in significant savings in file size without any changes in the perceived image. This generally works OK with photographs, which is the intended image type.
Also, if your images are larger than 16mp then Google will reduce the physical size of the image to 16mp. See Choosing a storage size. |
H: Is it possible to target the spouse of someone who meets certain demographics/interests with a Facebook ad?
Does Facebook have a way to target the spouse of someone who meets certain demographic/interest criteria? For example, could you target an ad to spouses of firefighters or spouses of teachers?
AI: No, there is no direct way. There are seven ways to target an audience:
Custom Audiences
Location
Demographics
Age & Gender
Interests
Behaviors
Connections
In your case you can use Custom Audiences option. For this You should know all the firefighters' and teachers' spouse Facebook ID or email address or username.
You can try Demographics/Interests also but it will target all the people. |
H: How to make Google Images display results in an "inline frame"?
Sometimes, Google Images results are shown in an "inline frame": when you click a picture from the results, it pops a black frame with preview, link to image, link to page and related image, as in the screenshot below:
But sometimes images in results only link to the direct image (ie clicking on an image just sends you to the image URL).
The exact same URL behaves differently on two browser, and the behavior is not consistent on the same browser, so I suspect there's a setting somewhere but I cannot find any.
Any clue?
AI: It depends on the version of Google you use.
If you use google.com, images will be shown in the inline frame you mention.
If you use google.fr or google.de for example, images will be shown loaded in a frame with the page that the image appears on in the background. |
H: How to add a movie to my watchlist in IMDb, in the movie page?
This seems to be a trivia question, but I can't find a button to add a movie into my watch list, in that movie page. The only button I can find is in the recommendation box:
I know that I can add a movie through my watch list page, but that's not what I'm looking for:
AI: If it is the new site of IMDB then the "Add to watchlist" icon is just in front of the movie title. See the image below: |
H: How to merge issues with Bitbucket?
I have 2 issues that talk about the same problem in Bitbucket.
How do I merge them or close one to point it to the other?
AI: The easiest way would be to close the duplicates, and cite the original issue.
closing #4 as duplicate, see #2
'closing' and 'see' are keywords that automatically change '#4' and '#2' to links for those issues.
You can do this in a commit message or when you resolve the issue in the Issue Tracker.
More information here: Available commands |
H: IMPORTHTML at a certain time of day in Google Spreadsheets
I am looking for a way to import the table from this formula once per day at a certain time instead of automatically updating as the formulas seems to do. I need to do this in order to track certain movements in the market every day.
=IMPORTHTML("http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/corn.html","table",1)
AI: If logging the entire table
I would keep importhtml in one sheet and use another sheet for historical log. Below these are Sheet1 and Sheet2.
function dailyLog() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var currentSheet = ss.getSheetByName('Sheet1');
var logSheet = ss.getSheetByName('Sheet2');
var lastRow = logSheet.getLastRow();
logSheet.getRange(lastRow + 1, 1).setValue(new Date()); // insert timestamp
var range = currentSheet.getDataRange();
range.copyTo(logSheet.getRange(lastRow + 2, 1), {contentsOnly: true});
}
This script should be set to run daily (in Script Editor, go to Resources > This project's triggers, and create a daily trigger for it).
The script copies the data range of Sheet1 to the end of the data range in Sheet2, keeping the contents only (an equivalent of manual action Ctrl-Shift-V).
If logging the first row of the table
First, wrap your importhtml() command in array_constrain(..., 2, 99) so that only two rows of the table are present in the sheet: the headers and the first data row.
Then schedule the following function to run daily. It takes the second row of the sheet and copies it below, within the same sheet.
function dailyLog() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Sheet1');
var lastRow = sheet.getLastRow();
var lastColumn = sheet.getLastColumn();
var range = sheet.getRange(2, 1, 1, lastColumn);
range.copyTo(sheet.getRange(lastRow+1, 1), {contentsOnly: true});
} |
H: Prevent user from opening issues
I would like to stop a problem user from opening further issues and commenting. I own the repository. I see the block option, but it is not clear what it does.
AI: I did my own experiment, here is what I found:
If you block a user, they will be prevented from commenting or opening issues on any repos that you own
For any repos where you are a collaborator, they are unencumbered
Also I found this:
http://help.github.com/articles/blocking-a-user-from-your-personal-account |
H: Getting COUNTIFS to work in complicated Google Sheets formula
I'm having trouble with COUNTIFS on Google Sheets. I've been able to use SUMIFS and now I need to use COUNTIFS.
I tried to do a Find and Replace, changing SUMIFS to COUNTIFS, on what I thought were similar criteria.
What are the differences between parameters on SUMIFS and COUNTIFS? More importantly, how do I make the formula work?
Some context:
I'm working on a dashboard that consolidates website and social media analytics data from several offices around the world.
We are using Google Sheets for easier collaboration among the communications managers at each office.
The dashboard needs to present a table of a number of metrics on a monthly basis. We archive the dashboard at the end of each year, then present to senior management. The data is used to inform global communications strategy.
Each office maintains its own website and social media accounts. When the dashboard was initially set up, data was manually entered for all fields.
Then I installed the Google Analytics add-on and designed the following formula to populate the table:
=IF(ISERROR(IF(SUMIFS('Canada Raw Data'!$D$15:$D$2840,'Canada Raw Data'!$A$15:$A$2840,">=1/1/2016",'Canada Raw Data'!$A$15:$A$2840,"<=01/31/2016")=0,"",SUMIFS('Canada Raw Data'!$D$15:$D$2840,'Canada Raw Data'!$A$15:$A$2840,">=1/1/2016",'Canada Raw Data'!$A$15:$A$2840,"<=01/31/2016"))),"",IF(SUMIFS('Canada Raw Data'!$D$15:$D$2840,'Canada Raw Data'!$A$15:$A$2840,">=1/1/2016",'Canada Raw Data'!$A$15:$A$2840,"<=01/31/2016")=0,"",SUMIFS('Canada Raw Data'!$D$15:$D$2840,'Canada Raw Data'!$A$15:$A$2840,">=1/1/2016",'Canada Raw Data'!$A$15:$A$2840,"<=01/31/2016")))
Here is a screenshot that might help:
In a separate sheet we run the raw data from the Google Analytics add-on (called 'Canada Raw Data'). The dates run from A15 onward. In the January column in the tab in the screenshot, it basically says, "if the date is after Jan 1 and before Jan 31, include the value in the sum." To keep the table tidy, I've wrapped it in ISERROR.
Rinse and repeat for Feb-Dec.
Where I get stuck is in Twitter. I've downloaded a CSV from Twitter Analytics for all tweets so far in January and copied these values to a sheet called 'Canada Twitter Raw Data'.
Then I added a column "date" to pull the left-most ten characters from Twitter's "time" and tell Sheets to understand that it's a date:
=DATEVALUE(LEFT(E2,10))
After a few Find and Replaces, I was able to replicate the formula for the new ranges with relative simplicity.
It worked when I was still using SUMIFS. See it working in the Retweets cell C23:
=IF(ISERROR(IF(SUMIFS('Canada Twitter Raw Data'!$I$2:$I$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016")=0,"",SUMIFS('Canada Twitter Raw Data'!$I$2:$I$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016"))),"",IF(SUMIFS('Canada Twitter Raw Data'!$I$2:$I$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016")=0,"",SUMIFS('Canada Twitter Raw Data'!$I$2:$I$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016")))
What I need to know to populate C19 is how many tweets were sent in January. I wanted to count the Permalinks using the same approach as SUMIFS:
=IF(ISERROR(IF(countifs('Canada Twitter Raw Data'!$C$2:$C$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016")=0,"",countifs('Canada Twitter Raw Data'!$C$2:$C$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016"))),"",IF(countifs('Canada Twitter Raw Data'!$C$2:$C$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016")=0,"",countifs('Canada Twitter Raw Data'!$C$2:$C$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016")))
Yet, as you can see, the cell is still blank. Removing the ISERROR wrapping gets me the #N/A error you see in D19, which contains the following formula:
=(IF(countifs('Canada Twitter Raw Data'!$C$2:$C$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016")=0,"",countifs('Canada Twitter Raw Data'!$C$2:$C$2840,'Canada Twitter Raw Data'!$A$2:$A$2840,">=1/1/2016",'Canada Twitter Raw Data'!$A$2:$A$2840,"<=01/31/2016")))
The error message in the #N/A:
Error
COUNTIFS expects all arguments after position 2 to be in pairs.
What's the best way to populate that Tweets field for each month? Let me know if you would make any other changes to my formulas.
AI: You can do a count for each month by transforming an array formula to only count based on that month:
=COUNTIF(ARRAYFORMULA(TEXT('Canada Twitter Raw Data'!A2:A,"MM")),"01")
change the "01" for each month so february would look like this:
=COUNTIF(ARRAYFORMULA(TEXT('Canada Twitter Raw Data'!A2:A,"MM")),"02") |
H: Months and weekdays in localized language
I would like to use Cognito Forms to output the weekday of a calculated date in a specific language. However, when I use the formula DateTime.Today.DayOfWeek for example, it will always give me the day of the week in English, not in the language I have set in the form settings.
Is there some way I can make the form display a localized day of the week?
AI: Dates and numbers are automatically localized in Cognito Forms whenever they are converted to text using the country and language settings for your form. The following example shows how to convert dates into localized text showing the day of the week and the month of the year.
Builder View
The Actual Form
Our help documentation on date calculations includes comprehensive examples for formatting dates and times as text:
https://www.cognitoforms.com/support/48/calculations/datetime-calculations |
H: How do I create a data validation function to print the values of a specified column across all pages?
I have a specific task that I believe might require some kind of custom script.
Here is (a copy) of the spreadsheet in question: https://docs.google.com/spreadsheets/d/1fwk-I3VHIeQP4AC4J-vQB8vbuM3YONgCfTTSrDSNhz8/edit#gid=850165930
This spreadsheet is a template for designing the content model of a piece of software. As such, users will be copying the Sheet entitled "---" depending on the configuration of their project.
My question refers to Column C across all of these pages, entitled "Bound Values". I need some way for all variables within this column (across all pages) to be printed within a single column on a hidden sheet (represented by the sheet titled "").
End Goal
Whenever editing cells in the "Bound Values" column, I would like to have the option of selecting previously used variables within this column across other pages.
I can currently only do this by referencing a single, static sheet that I would need to manually update (which is time consuming).
Another way of looking at it
I would use this on the hidden sheet to scrape all cell values across all pages in column C:
.
My Questions Are:
How might one be able to do this in Google Sheets, if at all?
If not, how might a script be structured to achieve this?
AI: If the names of sheets were known, you'd be able to do something like
={filter(Sheet1!C2:C, len(Sheet1!C2:C)); filter(Sheet2!C2:C, len(Sheet2!C2:C)); ... }
to join all of those together.
But since new Sheets will be added, and you don't know what names they will have, you need a script. I can think of two approaches: (a) the script will collect the data from C-columns itself; (b) the script will update the formula (of the above form) that will do the rest. The second one seems easier to code so I'll go with that.
function updateFormula(e) {
if (e.changeType === 'INSERT_GRID' || e.changeType === 'REMOVE_GRID') {
var sheets = e.source.getSheets();
var formulaBits = [];
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].getSheetName() !== '') {
var quotedName = "'"+sheets[i].getSheetName()+"'";
formulaBits.push('iferror(filter('+quotedName+'!C2:C, len('+quotedName+'!C2:C)))');
}
}
var formula = '={'+formulaBits.join('; ')+'}';
e.source.getSheetByName('').getRange('C1').setFormula(formula);
}
}
To deploy:
Open Tools > Script Editor and put the above code there. Click Save.
Go to Resources > "This project's triggers" and create a trigger with parameters "from spreadsheet", "on change".
You may want to add a sheet yourself to make the script run the first time; after that it will update the formula in cell C1 of sheet whenever a new sheet is added or a sheet is removed.
In case of renamed sheets, the software takes care of renaming itself, adjusting the formula automatically. |
H: Date format in Google Sheets
I have a Google spreadsheet file and I need to convert the date column from this format: Sun, May 4, 2014 4:30PM to this format: mm/dd/yyyy. Basically, I need the date to be in a simple format and take out the “day” and “time”.
How can I do this?
Here is the link to the spreadsheet:
https://docs.google.com/spreadsheets/d/1s4EwFa7r0rdF24w3lAuasfcCw8kf1k4to4Y8dQdZjhI/edit#gid=1354673218
AI: This will fix it for you:
=text(regexreplace("timestamp","^\w{3},",""),"MM/DD/YYYY")
you could also transform to remove the additional time parameter at the end with this:
=text(regexreplace(regexreplace("timestamp","^\w{3}, ",""), ", \d+:\d+\w+",""),"MM/DD/YYYY")
OR if your data consistently is formatted the way you did in your examples (with the commas present) you can simply do this:
=TEXT(REGEXEXTRACT(C10,",(.*),"),"MM/DD/YYYY") |
H: How to list which values from field A don't appear in field B? (Survey recipient responses)
I have a weekly survey I send out to the same list of people using Google Forms, and they populate a 'responses' spreadsheet. I delete the responses weekly, and new rows are added as new responses are created. I've included a master list of respondents below the summary row (A19:A32), which is not affected by adding/deleting of responses. I'd like to create a list of people who haven't yet responded. Here's the Google Sheets link.
I feel I'm very close, but can't figure out the last step. I've cobbled together code from here and here. I use the INDEX and SPLIT functions (discussed in the second source) to return first names only, since respondents sometimes use last names. I've gotten this to work properly, in isolation (cell F2).
The meat of the formula is the FILTER, NOT, and COUNTIF functions, a solution presented by Anthony-DiSanti. I got this formula to work on my 'raw' respondents list (in cell D19):
=FILTER(A19:A32, NOT(COUNTIF(B:B, A19:A32)))
When I say it works: it lists only those people who have not responded, or whose names don't match my list because they've included their last names also.
Now to resolve the name issue. But when I try (in cell C19) to integrate the functions to modify the names to isolate just the first name, it seems to invert the results: instead of only listing people who haven't responded, it lists everyone.
=FILTER(A19:A32, NOT(COUNTIF(index(split(B:B, " "),1,1), A19:A32)))
Obviously I'm pretty new at this, so any suggestions beyond the scope of my questions are welcome. (For instance, I'm not sure how to get around having two separate Miguels on the list.)
AI: The problem is that split does not work with an array (unfortunately). There are workarounds though. In your case, replacing index-split with regexextract does the job:
=FILTER(A19:A32, NOT(COUNTIF(regexextract(B:B, "^\S+"), A19:A32)))
The regular expressiion ^\S+ means: get all non-whitespace characters at the beginning of the string, which is what you tried to do.
Aside: you have two Miguels on your list, so ignoring last names might not be such a good idea. What if one Miguel responds and the other doesn't? |
H: How to NOT create a link in a tweet
Whenever I type something resembling a URL (for example "asp.net") at twitter.com, it automatically converts it into a real link. Is there a way to 'escape' this conversion if I want it to remain plain text?
AI: The only practical way I've found is to munge the URL in some way. Enclosing in single-quotes, double-quotes, parentheses, brackets, braces, backticks, etc., has no effect.
The classic way is to "escape" the dot character: asp[dot]net.
Adding a couple of extra spaces around the dot would also do the trick: asp . net.
If you can manage to insert a zero-length character (such as U+200B) in the string, that should do the trick as well. (Alt+08203 seems to work on Windows.)
The only other way I can see to make this happen is to use a third-party Twitter client. Then again, the API may convert the URL-like strings to URLs on the server side anyway. |
H: How do I change the default font color on paste on Google Slides?
Every time I paste a text onto a specific document on Google Slides, it changes its font definitions, including color to white, even if the color of the original text and the color of the text area where it's being pasted are black. I know how to change the color after (although it's hard to select it if the background is also white!), I want to know if there is a specific setting to change it by default.
Some details:
it works correctly on other documents and it was working ok before for this one; I'm not sure if I pressed a keyboard shortcut accidentally that triggered the issue
the issue happens on text copied from the web or even if it's a URL on Google Chrome
I've checked that the colors on the "master" are correct
This is the resulting "new" format after I paste the text (original is Arial black, 14)
AI: I fixed this issue by refreshing (reloading) the page. |
H: How can I list all my unread messages in LinkedIn?
I wonder how I can list all my unread messages in LinkedIn. I am aware of the "Unread" category in the mailbox, but in my case it is empty while the new message icon indicate the presence of 18 unread messages:
AI: It's a bug. LinkedIn has to fix it but they are not caring about it.
Here is a thread on Help Center where people have complained about it but there is no response from LinkedIn. |
H: Remove any sheets not listed in an array
I have a Google App Script that has 6 sheets. onOpen, I would like to see if the user created any additional sheets, and if so, delete them.
So far, I have:
function onOpen(){
var all_sheet_names = ["Instructions", "Data", "Print", "Schedule" ,"Archive", "Projections"];
var sheets_present = sheetnames();
Logger.log(sheets_present);
var diff = difference(sheets_present, all_sheet_names);
Logger.log(diff);
}
function difference(all_sheets, all_sheet_names) {
var result = [];
for (var i=0; i < all_sheets.length; i++) {
if (all_sheet_names.indexOf(all_sheets[i]) === -1) {
result.push(all_sheets[i]);
}
}
return result;
}
function sheetnames() {
var all_sheets = new Array()
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
for (var i=0 ; i<sheets.length ; i++) all_sheets.push( [ sheets[i].getName() ] )
return all_sheets
}
My return from difference is just an array of all sheets, not just the ones that are different.
Any suggestions?
AI: The problem is here:
all_sheets.push( [ sheets[i].getName() ] )
This should be changed to
all_sheets.push( sheets[i].getName() );
The second version inserts a sheet name into array, which is what you want. The first version inserts a one-element array into array, resulting in a double array like [['Sheet1'], ['Sheet2'], ['Sheet3']].
For completeness, here is how I would write the whole thing:
function onOpen() {
var all_sheet_names = ["Instructions", "Data", "Print", "Schedule" ,"Archive", "Projections"];
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
for (var i = 0; i < sheets.length; i++) {
if (all_sheet_names.indexOf(sheets[i].getSheetName()) == -1) {
ss.deleteSheet(sheets[i]);
}
}
} |
H: How to calculate the percentage of a year up to a date is of the whole?
Given a date, I need to calculate the percentage of its position in the year. So that 31-12-2015 would return 1, or 100%, because it's the 365th day of 365 days in that year. And 1-1-2015 would return 0,274% (1/365).
I have a long formula solution
=MINUS(
A1;
DATE(YEAR(A1)-1;12;31)
) / MINUS(
DATE(YEAR(A1);1;1);
DATE(YEAR(A1)+1;1;1)
)
Basically it counts the day of the year of the date given in A1 and divides that by the number of days in that year.
Is there a way to do this with a shorter formula?
AI: Here is a shorter formula that is equivalent to yours, using yearfrac:
=yearfrac(date(year(A1), 1, 1), A1, 1)
However, the formula you have is inconsistent with your description, since it returns 0 for 1-1-2015, representing that at the beginning of that day, no time has elapsed since the beginning of the year. To have 1/365 for 1-1-2015 and 1 for 12-31-2015, add 1 to the date, to calculate each day's end:
=yearfrac(date(year(A1), 1, 1), A1+1, 1) |
H: How to prefill date fields via URL in Cognito Forms?
I am trying to assign a value to a date type field via URL parameter to embedded form. Works fine with text fields, but can't get anything to populate the date type field. Is this possible? If so what's the trick?
?entry={"Program":"test program","GroupName":"test group","ProgramDate":"02/15/2016"}
Also tried 2016-02-15, 2016/02/15, 02-15-2016, etc
AI: Prefilling your forms in Cognito Forms requires understanding the JSON format used when your entries are saved, posted to endpoints, etc. Fortunately, this format is pretty much what you would expect, with the names being the field names like you use in calculations, text values in quotes, numbers are numbers, and yes/no values are true or false.
Dates on the other hand get a bit interesting as JSON technically does not have a standardized representation for dates. However, while researching date handling for Cognito Forms, we realized that the ISO 8601 date format had become the defacto standard that everyone was using despite the lack of an official JSON standard. In the case of dates, we use just the date portion of the standard and avoid including the timezone, which avoids unexpected date shifts when viewing entries in different timezones. Similarly for times, we use the time portion without a date or timezone. And for things like the entry timestamp that are both a date and time, we use the full ISO 8601 format in the UTC timezone.
So given all of that, dates are represented as "YYYY-MM-DD" in the JSON structure for your forms. You tried this option, which should have worked, so please try this again and see if you have better luck knowing this is the correct answer.
Here is a link demonstrating date prefill using this format:
Date Prefill Example |
H: How to convert text of the form Month-Year to date format?
How do I convert the text "Oct-14" to date, so that it's being read as "Oct 01, 2014. I tried to go to Format > Date and selected the format: Oct-2014, but google sheets is interpreting it as "Oct 14, 2016". I just need the month and year (Oct-2014).
Here's the sample spreadsheet: I need help with columns B and C.
AI: You can use
=datevalue("01-"&B2)
(single-cell formula that can be copied down), or
=arrayformula(datevalue("01-"&B2:B))
(converts an entire column at once), or
=arrayformula(iferror(datevalue("01-"&B2:B)))
(does the same, while suppressing any error messages).
This works because the strings like 01-Oct-14 are understood by datevalue command correctly, at least in your locale. |
H: Sync Office 365 calendar to Google calendar
I could not find an up to date question about how to sync an Office 365 calendar to Google calendar. I do not wan't to use an application designed to use the desktop version of Outlook like OggSync and similar software. I want it to be done only using the web apps without me having to update it every time I make a new calendar event, it should be done automatically.
AI: The solution is to log into Office 365 via https://portal.office.com, click on Calendar and then click on Calendar again under "My app settings". Go to publish calendar and publish the desired calendar. Copy the ICS url created.
Log into Google Calendar and click the arrow on "Other calendars". Click the button "Add by URL" and paste the .ics link from Office 365. Google Calendar is now automatically updated with new events from Office 365 calendar. |
H: How to recombine text into one line in Google Sheets
=index(ImportXml("https://www.google.com/finance?q=ibm", "//div[@class = 'companySummary']" ),0,1)
Put that anywhere in a Google sheet and it will give you a cell with a block of text. This text is in a paragraph form and takes up several lines. How do I use formulas to make it so the text is one line? It's possible because I can do it by hand if needed.
I've tried:
=join(" ",split(A1," "))
AI: Short answer
Use the following formula
=SUBSTITUTE(A1,Char(10)," ")
Explanation
IMPORTXML added line feed characters which ASCII code is 10. An alternative to the use of Char(10) is to add a breakline (CTRL + ENTER) and enclose it in quotes marks:
=SUBSTITUTE(A1,"
"," ") |
H: How to grab an HTML link from a table?
Behind each of the company names here is an HTML link to another page.
How do I import that HTML link into Google Sheets?
AI: You can pull in those links with this formula:
=IMPORTXML("http://www.nasdaq.com/markets/ipos/activity.aspx?tab=upcoming","//tr/td[1]/a/@href") |
H: Change Gmail date format to ISO 8601 (i.e., yyyy-mm-dd)
Is there any way to change Gmail date format to ISO 8601 (i.e., yyyy-mm-dd)?
Instead of :
AI: I don't see a built-in way to switch to ISO format, but I wrote a userscript for this. Tested in Chrome with Tampermonkey. If Tampermonkey is installed, clicking Raw button in Github should prompt for script installation.
You did not ask for time format to be changed, so I kept it as is for today's emails:
Including script here for completeness. (added wildcards to URL)
// ==UserScript==
// @name ISO date format in Gmail
// @namespace https://github.com/normalhuman/
// @version 16.2.1
// @description Change Gmail date format to ISO 8601, per http://webapps.stackexchange.com/q/89499
// @author Normal Human
// @match http*://mail.google.com/mail/u/0/*
// @grant none
// @run-at document-idle
// ==/UserScript==
/* jshint -W097 */
'use strict';
window.setInterval(toISO, 500);
function toISO() {
var rows = document.getElementsByTagName('tr');
for (var i = 0; i < rows.length; i++) {
var rowElements = rows[i].children;
if (rowElements.length == 8) {
var timestamp = rowElements[7].firstElementChild;
if (!/:/.test(timestamp.textContent)) {
var parts = timestamp.title.split(/, | | at /);
if (parts.length == 7) {
var month = 1 + ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'].indexOf(parts[1]);
timestamp.textContent = parts[3] + '-' + ('0' + month).slice(-2) + '-' + ('0' + parts[2]).slice(-2);
}
}
}
}
} |
H: Create an OR conditional statement from a list of options
I want this: input in A1 and output in A2.
input: 0 output: AND (A=0)
input: 0,1 output: AND (A=0 OR A=1)
input: 0,1,2 output: AND (A=0 OR A=1 OR A=2)
etc...
I've tried a few things with the REPT function but can't get it to work.
AI: This worked for me when I tested it with your sample strings:
="AND(A="&SUBSTITUTE(A1,","," OR A=")&")"
It basically replaces each comma with the or part of the string. |
H: What is “Error -2” on Zapier
I am trying to set up a zap on zapier.com with a webhook to my own site. However, I am getting the following error:
Bargle. We hit an error creating a post. :-( Error:
-2
I can't seem to find a reference to -2 in relation to Zapier on Google.
I tested my URL on my site and it executes without error.
Does anyone know what the issue is?
AI: I found the solution. I had entered my URL without http:// in front of it.
Works fine as long as I put http:// in front of the URL. |
H: Can I cut and paste projects from a Google sheet using a script?
I want an automated method of cutting and pasting completed projects from one sheet to another sheet. I want to have a column where users can go in and type "DONE" at the end of a row to state that that particular project is complete and then I want a script to recognize that and cut the whole row and paste it into another sheet. It would be even better if the script went ahead and deleted the row from the sheet after it is done cutting the data and pasting it so that there aren't blank rows left over.
AI: Here is a script that does the following: if a user enters 'DONE' in any cell in sheet named 'Sheet1', the row with that cell is copied over to Sheet2, and deleted from Sheet1. To use, just enter in Tools > Script Editor, and change sheet names if needed.
The script does not check that 'DONE' is in the last nonempty cell of a row: it can be anywhere.
function onEdit(e) {
if (e.value === 'DONE') {
var sheet = e.range.getSheet();
if (sheet.getSheetName() == 'Sheet1') { // Name of the sheet with projects
logSheet = e.source.getSheetByName('Sheet2'); // Name of the archive sheet
var row = e.range.getRow();
var lastRow = logSheet.getLastRow();
var range = sheet.getRange(row, 1, 1, sheet.getLastColumn());
range.copyTo(logSheet.getRange(lastRow + 1, 1));
sheet.deleteRow(row);
}
}
}
Depending on the contents of your spreadsheet, you may want to replace the copying command with
range.copyTo(logSheet.getRange(lastRow + 1, 1), {contentsOnly: true});
so that only static values are copied, not formulas. This makes sense if the row contains formulas that would stop working properly if moved to another sheet. |
H: Union of two lists of key-value pairs
In a spreadsheet I have two lists (key-value pairs basically) that look like this:
[A] [B] [D] [E]
a 23 b hello
b 42 d world
c 11 f good
f 17 g bye
h 88
And I would like to get something that looks like this:
a 23 -
b 42 hello
c 11 -
d - world
f 17 good
g - bye
h 88 -
Is there a way to achieve this inside Google Sheets? I could download the csv file and write a program for it, but looking around on this site it seems that Google Sheets is powerful and a lot of these things can be done without leaving it.
AI: A quick way to do it is indeed to use vlookup. For example: in F1 I'd put
=sort(unique({A1:A; D1:D}))
which collects the data from two columns, eliminates repetition, and sorts.
Then in G1 put
=arrayformula(iferror(vlookup(F1:F, A$1:B, 2, False)))
which takes the matching values from B column. Similarly, for H1 use
=arrayformula(iferror(vlookup(F1:F, D$1:E, 2, False)))
If your spreadsheet has a lot of empty rows at the bottom, these array formulas are slightly inefficient in that they look up a lot of empty values. In this case, replacing F1:F with filter(F1:F, len(F1:F)) helps: this filters down to nonempty values in F.
Technical remarks: iferror(...) suppresses error messages that arise when nothing is found by vlookup. arrayformula is used to avoid having to drag the formula down the column: it processes the entire column at once, and returns an array of results. |
H: How to shrink column when wider than the window?
I double clicked the column border so it expanded wider than the window. When I scroll to the left it jumps, so I can't see the previous column.
How do I shrink it down?
AI: You can right-click the top of the column (Command+click on a Mac), choose "Resize column" and enter some reasonable value (the default is 100; the width is measured in pixels). |
H: How can I get the halfway date of two dates in Google Sheets?
I have two date columns in mm-yy format and I need to know the halfway date of these two. What formula do I use? I tried simple subtraction of the two dates and then divided it by two but it didn't yield the right result.
Here's the link to the spreadsheet:
https://docs.google.com/spreadsheets/d/18wUcq_zBV4MdcXTUShYl7N2cx_TBVq9EONSIGvVlsuk/edit#gid=836202959
AI: To find the number that's halfway between A2 and B2, use the formula
=(A2+B2)/2
(You'll need to apply a suitable date format to the output.) |
H: Extract the link text and URL from a hyperlinked cell
Suppose I have a hyperlink in cell A1: =hyperlink("stackexchange.com", "Stack Exchange")
Elsewhere in the sheet, I'd like to have formulas that get the link text and URL from A1, separately. I found a way to get just the link text:
=""&A1
(concatenation with empty string). This returns "Stack Exchange", unlinked.
How to get the URL (stackexchange.com)?
AI: After seeing Rubén's answer I decided to write a different custom function for this task, with the following features:
The parameter is provided as a range, not as a string: that is, =linkURL(C2) instead of =linkURL("C2"). This is consistent with how parameters usually work, and makes the references more robust: they will be maintained if someone adds a new row on top.
Arrays are supported: =linkURL(B2:D5) returns the URLs of all hyperlink commands found in this range (and blank cells for other places).
To achieve 1, I do not use the argument passed by the sheet (which would be the text content of the target cell), but instead parse the formula =linkURL(...) itself and extract range notation from there.
/**
* Returns the URL of a hyperlinked cell, if it's entered with hyperlink command.
* Supports ranges
* @param {A1} reference Cell reference
* @customfunction
*/
function linkURL(reference) {
var sheet = SpreadsheetApp.getActiveSheet();
var formula = SpreadsheetApp.getActiveRange().getFormula();
var args = formula.match(/=\w+\((.*)\)/i);
try {
var range = sheet.getRange(args[1]);
}
catch(e) {
throw new Error(args[1] + ' is not a valid range');
}
var formulas = range.getFormulas();
var output = [];
for (var i = 0; i < formulas.length; i++) {
var row = [];
for (var j = 0; j < formulas[0].length; j++) {
var url = formulas[i][j].match(/=hyperlink\("([^"]+)"/i);
row.push(url ? url[1] : '');
}
output.push(row);
}
return output
} |
H: Print several non-consecutive columns of a Google Spreadsheet using a script
I have script for print. I need print range without some column (e.g. print just B,C,D,E,G and miss F) and without all notes in sheet.
The script below prints all the columns.
function printPdf() {
SpreadsheetApp.flush();
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var gid = sheet.getSheetId();
var pdfOpts = '&size=A4&fzr=false&portrait=false&fitw=true&gridlines=false&printtitle=false&sheetnames=false&pagenum=UNDEFINED&attachment=false&gid='+gid;
var last_row = sheet.getLastRow();
var printRange = '&c1=0' + '&r1=0' + '&c2=34' + '&r2='+last_row // B2:APn
var url = ss.getUrl().replace(/edit$/, '') + 'export?format=pdf' + pdfOpts + printRange;
var app = UiApp.createApplication().setWidth(200).setHeight(50);
app.setTitle('Verze pro tisk');
var link = app.createAnchor('Zobrazit PDF', url).setTarget('_new');
app.add(link);
ss.show(app);
}
AI: I don't know of a way to select a non-contiguous range via URL parameters. The solution I found is to create a new temporary spreadsheet, copy selected columns there, and export the new sheet into PDF. In the script, the array cols holds the columns to be taken: B-E and G correspond to 2,3,4,5,7.
Version 1: print without formatting
function printPDF() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = SpreadsheetApp.getActiveSheet();
var cols = [2, 3, 4, 5, 7]; // columns to print
var lastRow = sheet.getLastRow();
var newSs = SpreadsheetApp.create(ss.getName() + ' for print', lastRow, cols.length);
var newSheet = newSs.getSheets()[0];
for (var i = 0; i < cols.length; i++) {
var values = sheet.getRange(1, cols[i], lastRow, 1).getValues();
newSheet.getRange(1, i + 1, lastRow, 1).setValues(values);
}
SpreadsheetApp.flush();
// copied from your code, including deprecated UiApp
var pdfOpts = '&size=A4&fzr=false&portrait=false&fitw=true&gridlines=false&printtitle=false&sheetnames=false&pagenum=UNDEFINED&attachment=false&gid=0';
var url = newSs.getUrl().replace(/edit$/, '') + 'export?format=pdf' + pdfOpts;
var app = UiApp.createApplication().setWidth(200).setHeight(50);
app.setTitle('Print Version');
var link = app.createAnchor('Show PDF', url).setTarget('_new');
app.add(link);
ss.show(app);
// End of copy
DriveApp.getFileById(newSs.getId()).setTrashed(true); // delete temp file
}
Version 2: print with formatting
Similar to the above, but instead of creating a new spreadsheet, a new sheet 'print' is inserted (if such a sheet already exists, it is reused).
function printPDFold() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = SpreadsheetApp.getActiveSheet();
var cols = [2, 3, 4, 5, 7];
var lastRow = sheet.getLastRow();
var newSheet = ss.getSheetByName('print');
if (!newSheet) {
newSheet = ss.insertSheet('print');
}
var gid = newSheet.getSheetId();
for (var i = 0; i < cols.length; i++) {
sheet.getRange(1, cols[i], lastRow, 1).copyTo(newSheet.getRange(1, i + 1, lastRow, 1), {contentsOnly: true});
sheet.getRange(1, cols[i], lastRow, 1).copyTo(newSheet.getRange(1, i + 1, lastRow, 1), {formatOnly: true});
}
SpreadsheetApp.flush();
var pdfOpts = '&size=A4&fzr=false&portrait=false&fitw=true&gridlines=false&printtitle=false&sheetnames=false&pagenum=UNDEFINED&attachment=false&gid=' + gid;
var printRange = '&c1=0&r1=0&c2=' + cols.length + '&r2=' + lastRow;
var url = ss.getUrl().replace(/edit$/, '') + 'export?format=pdf' + pdfOpts + printRange;
var app = UiApp.createApplication().setWidth(200).setHeight(50);
app.setTitle('Print Version');
var link = app.createAnchor('Show PDF', url).setTarget('_new');
app.add(link);
ss.show(app);
}
The presence of two copyTo commands may look strange, but this is necessary because:
contentsOnly: true is for copying the values and not the formulas (since formulas will likely break if moved to another sheet where not all columns are present)
formatOnly: true is to copy the formatting.
Unfortunately, it does not seem to be possible to hide the 'print' sheet: if it's hidden, the PDF file fails to load.
Remark
As an alternative to export via URL parameters, one can save a PDF to Drive from where it can be opened as before. Here is an outline of this approach; I don't know how to turn off gridlines, etc.
var file = DriveApp.createFile(newSs.getAs('application/pdf'));
file.setSharing(DriveApp.Access.ANYONE_WITH_LINK, DriveApp.Permission.VIEW);
var url = file.getUrl(); |
H: What exactly happens when you "Archive" messages in Gmail?
Gmail has "Archive" button for messages.
What exactly is the effect of "archiving"?
Is it the same as deleting?
AI: Archiving in Gmail is simply the act of removing it from your "Inbox". By removing the "Inbox" label.
An archived email is not deleted. However, they are not immediately visible by default.
Archived email appears under "All Mail" (system label on the left hand side, under "Inbox"), but the "All Mail" system label is not displayed by default. Under Settings > Labels you can show/hide the "All Mail" label.
(As you can see from the screenshot, I should archive more!)
Reference (Gmail help):
Archive messages in Gmail |
H: What is the shortcut for replace in CodePen?
In CodePen, what is the keyboard shortcut for 'Find & Replace'?
The help screen lists Ctrl+⌥+F, but the "option" key is for Macs.
What is the Windows equivalent?
Ctrl+Alt+F has no effect.
AI: Through experimentation, it appears to be Ctrl+Shift+F. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.