text
stringlengths 83
79.5k
|
---|
H: How do I upload animated gifs from Twitter onto Facebook and have them animate?
Animated GIFS on Twitter are great for capturing a meme. Downloading them is tricky, but can be done by reading the HTML source or using an external tool.
The problem I have is, whenever I upload an animated gif to Facebook, it fails to animate, only showing the first frame.
My question is: How do I upload animated gifs from Twitter onto Facebook?
AI: Twitter generates an mp4 for an animated GIF, so you can upload it as a video to Facebook.
e.g. via the API
https://api.twitter.com/1.1/statuses/show.json?id=479307198901026816
"variants": [
{
"bitrate": 0,
"content_type": "video/mp4",
"url": "https://pbs.twimg.com/tweet_video/BqbXWaHIYAEciGo.mp4"
}
So you can upload this |
H: Can I prevent Chat/Hangouts window from loading in Gmail?
When I'm on slow connection/slow browser, loading of Chat/Hangouts window in Gmail slows down opening of Gmail window a lot.
Is there a way to configure Gmail so that this window doesn't even start to load at all? (I don't use chat for this account so it is 100% useless to me.)
Just to be clear, I want to prevent the actual loading, NOT simply hide it but still load it in background.
AI: Short answer
Disable the chat in Gmail.
Instructions
Go to gmail.com
Go to Settings > Chat
Click in the radio Chat off
Click the Save changes button |
H: How does one find the http://go.microsoft.com/fwlink/?LinkId=XXX for an MSDN page?
It seems that the go.microsoft.com shortlinks for Microsoft pages are best practice to link to.
How do I find the shortlink for a MSDN page, in my case specifically?:
https://msdn.microsoft.com/en-us/library/mt163865.aspx
AI: You can't. We use shortlinks like that internally and the recommendation applies to internal products only (e.g. a page changes the URL, we don't need to update the product and just update the shortlink).
For your purposes, you can either use the direct link to the MSDN page or use one of the available URL shortening services. |
H: Is it possible to have Facebook displayed in the old, pre-2013 layout?
I wonder if one can have someone's Facebook timeline displayed in the old, pre-2013 layout/format? That is the short version of my question, which if you know the answer to, it will suffice. The explanation why I need this is given below:
What I need this for:
I have a backup of a person's entire Facebook timeline for over 7 years along with notes, images and comments. I recently became a friend of this person and discovered that he posted a lot of material "for friends only" and would like to create a new backup with the additional information, but I would rather update the old backup with the "friends only" information as the original backup contained many images and links to articles which aren't available anymore and which I would like to preserve. So is it possible to have a Facebook displayed in the old, pre-2013 layout?
AI: No, you can’t go back to old Facebook layouts. Not online at least. What you are trying to do might be possible offline, programatically, but it involves some work on your behalf. |
H: How can I put a Medium article on my personal website?
I want to include a full Medium article on my personal website. I know it's possible because it has been done here. (Notice the domain is not medium.com.)
If you click on ... on the bottom-right of a Medium article, and then click 'Embed story', you will be given a script, e.g.
<script async src="https://static.medium.com/embed.js"></script><a class="m-story" data-collapsed="true" href="https://thebillfold.com/theories-on-my-thrift-store-dog-mugs-or-who-paid-money-to-have-these-manufactured-562f9d5632a4">Theories on My Thrift Store Dog Mugs, Or: Who Paid Money to Have These Manufactured?</a>
The problem is that this embed is just the title and abstract. The full Medium article text is not included.
How can I embed a full Medium.com article on my personal website?
AI: That’s not an embedded article, it’a custom domain for Medium. See here for more details.
You need to create a Medium Publication in order to be able to publish with Medium on your own domain.
As per Medium Help, the embedding feature is no longer supported.
Can I embed Medium on other sites?
Medium embeds on other sites are no longer supported.
Regarding the embedding process, check the following note on the Embed Medium Anywhere help page.
Important: Some blog services strip script tags and this prevents Medium embeds from functioning. ☹
So that might be your problem.
Also, apparently, only the title and abstract of the post are embedded, not the full text. |
H: Google Drive on Linux release date?
Is there a planned release date, or any information on, when Google will release Drive application on Linux?
AI: I spoke to Google Customer Service about two weeks ago and they said they are working on a Linux Drive software but they do not have a roll-out date yet. |
H: Is the payment method for Lynda.com a subscription model?
I was talking to a friend about taking a class on Lynda.com, and they told me that I could get a free trial of the site. I thought it worked that you bought a class individually, but it doesn't sound that way...is this the case?
AI: Right there on the signup page, where you can choose either "Standard" or "Premium" and get a 10-day free trial, it also says:
What happens after the free trial period?
You'll automatically be charged your plan's rate on the 19th of every month unless you decide to cancel your account.
So, yes, it's a subscription model.
Also, from the FAQ page:
As a Lynda.com member, do I have access to everything?
Yes. Lynda.com members can watch each and every course in the library. Exercise files are available to monthly premium or annual premium members.
So, no, you can't purchase individual classes.
Fortunately, you may be affiliated with an organization that already has a subscription. For instance, my local public library has a subscription and I can view Lynda.com videos with just my library card. |
H: Can I have 2 recovery phone numbers in my Google account?
When I travel abroad, it often happens that my original carrier is not valid, which means that sometimes I have to change my phone number to another carrier when I am in another country. So effectively I have two phone numbers.
Is there a way to use two recovery phone numbers in Google?
AI: Yes, you can.
Go to your account
Under Security (was Sign-in & security), go to Signing in to Google
Go to 2-Step Verification
Under Backup options for when your primary is unavailable
Click Add a phone number
To use it, when you login, click Try another way to sign in under the code box. You will be presented with a list of options where you will find the second phone number as one of them. |
H: Gmail places sent mail in my inbox (Treat as an alias?)
Despite the very nice post https://webapps.stackexchange.com/a/25531/24693 it seems that I still don't understand Gmail's "Treat as an alias" option (the main thing I took away from that post was that if an address is technically "me" or mine, the intention is that i mark it as an alias, whereas if it's my boss or something, I would not check the option).
My problem: If I do not have this option checked, then when I reply all, it includes my address in the recipients, and I end up with the reply (that i've sent) in my inbox. If, on the other hand, I do mark the address as an alias, then messages I send (not even reply alls) are always in my inbox.
UPDATE: Even when the address is not an alias, sent mail from the address goes to my inbox
I would like to send mail and have those messages not in my inbox.
AI: So I found https://webapps.stackexchange.com/a/42968/24693 which I think solves my problem. I had a filter
from:(@someimportantdomainTHAT_I_HAVE_AN_ADDRESS_AT)
never send to spam
I changed it to:
from:(@someimportantdomainTHAT_I_HAVE_AN_ADDRESS_AT) -from:myaddress@thatdomain
never send to spam
n.b. despite me entering the new rule as above, it appears as follows in my filters list
from:(@someimportantdomainTHAT_I_HAVE_AN_ADDRESS_AT -myaddress@thatdomain)
never send to spam |
H: How do I hide Twitter Following/Likes?
A Twitter user's page usually shows Tweets, Following, Followers, Likes, and Lists at the top right below the banner image, as seen on @shanselman's Twitter page:
But it's apparently possible to hide everything but Tweets and Followers, as seen on
@IAmDeveloper's page:
What Twitter setting accomplishes this?
AI: It's not a setting. It's what happens when you don't use them.
If you didn't create any lists, Lists will not show.
If you don't favourite/like/heart any tweets, that Likes tab will not show on your profile either. |
H: How to re-add the security question in Gmail?
As we all might know that today is "Safe Internet Day". So Google is reminding us for the security check-up. I tried it. And I saw that I could remove my security question. I did it with the belief that I will add a better question (I forgot the answer of the earlier question anyway).
But when I tried it then I found that there is no option to add a new security question. I believe that the security question is necessary. Here is a picture how Recovery options looks like for me.
There should be something with the name called 'Security Question' below 'Recovery phone'. Is there a way by which I can add that question? When I removed it I even got a mail from Google. By clicking that link I was directly forwarded to 'My last device activity', which is definitely not helpful in adding the question again.
AI: Google found that security questions were not really secure at all as most of the answers can be found with a simple Google search. For example Sarah Palin had her Yahoo! account hacked because someone simply Googled her birthday, ZIP code and where she met her spouse.
Google has completely removed support for security questions and one only had the ability to remove already existing ones. There is no way to add your security question back in.
Perhaps you should consider enabling 2 - step verification, enabling this feature will make Google send a single-use code to your phone which you will have to enter as a second password. In this way even if someone manages to acquire your password, they will also need your phone to access your Google account.
Please also read: How to create a secure password. |
H: How can you edit text in draw.io shapes?
I know how to label shapes in draw.io by simply clicking on the shape and then typing, but how can I go back and easily edit These Labels without first deleting and recreating the entire text?
AI: Double click on the shape to start editing with the label intact. |
H: SMTP Settings for Gmail in DokuWiki?
I'm trying to setup a dokuwiki in Vagrant for demonstration purposes, and I'd like the people testing it out to be able to register and receive a verification email.
I've installed the dokuwiki-plugin-smtp and I'd like to be able to use an SMTP server with it.
I've found several places that state that gmail is good for this purpose, but I don't have a domain to send mail from as such.
Here's what I have done so far:
Went into my Admin settings for doku
Clicked Configuration Settings
Clicked smtp
In the Smtp section...and filled in the following values:
Your outgoing SMTP server: smtp.gmail.com
The port your SMTP server listens on. Usually 25. 465 for SSL: 465
What kind of encryption is used when communicating with your SMTP Server? SSL
If authentication is required, put your username here. <my-gmail-email-address>
Password for the above user. <my-gmail-email-address-password>
The name to be used during HELO phase of SMTP. Should be the FQDN of the webserver DokuWiki is running on. Leave empty for autodetection. Not sure what to put here.
Print a full error log when sending fails? Disable when everything works! Checked.
Clicked Save.
Went into <doku-home>/conf/dokuwiki.php and edited $conf['mailfrom'] so that it points to <my-gmail-email-address>.
Went back to the Admin screen in my browser..
Clicked Check SMTP configuration
In the testmail dialog tried to send an email to another email address using the To: field.
Clicked Send Mail
The following was the output:
Set: the server
Set: the auth
Set: a message will be sent
Connecting to smtp.gmail.com at 465
Got: 220 smtp.gmail.com ESMTP p206sm2da861897ywb.29 - gsmtp
Sent: EHLO [192.168.33.10]
Got: 250-smtp.gmail.com at your service, [207.255.6.224]
Got: 250-SIZE 35882577
Got: 250-8BITMIME
Got: 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
Got: 250-ENHANCEDSTATUSCODES
Got: 250-PIPELINING
Got: 250-CHUNKING
Got: 250 SMTPUTF8
Sent: AUTH LOGIN
Got: 334 VXNlcm5shbWU6
Sent: bGVlYW5kMDBdAZ21haWwuY29t
Got: 334 UGFzc3dvdcmQ6
Sent: dmlzaipMNzMhJkNWNVk=
Got: 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsdbvEf
Got: 534-5.7.14 xM8arKaU-YecG1GrUg1rUPPs6tdYNskmkjoyqwKryYWkCxW9PNKXHd6vt0yKIoauYjo1FLW
Got: 534-5.7.14 8aoPuega-taL5QSUdj03t5HpLNJ2vFEd_GIbBAvQo39Wi6Hpd3irkM3xV9sbVyyB7rCYMbs
Got: 534-5.7.14 OL8zl-onlXEiLP6f8J6FJFlF13Y1qmiNMiX7iJixQZJ_K8bs9docaAABH78hRSSGyiAGqZr
Got: 534-5.7.14 LX6UABKLBKdOddNqiyOHE16U3CVk> Please log in via your web browser and
Got: 534-5.7.14 then try again.
Got: 534-5.7.14 Learn more at
Got: 534 5.7.14 https://support.google.com/mail/answer/78754 p206sm2861897ywb.29 - gsmtp
The visiting the URL mentioned at the end https://support.google.com/mail/answer/78754 p206sm2861897ywb.29 yields no results.
I've also tried this configuration using a port setting in The port your SMTP server listens on. Usually 25. 465 for SSL of 587 and a setting for What kind of encryption is used when communicating with your SMTP Server? of 587 and I still can't send the email.
I got my settings for this here.
I keep thinking the issue might be where it asks for the The name to be used during HELO phase of SMTP. Should be the FQDN of the webserver DokuWiki is running on. Leave empty for autodetection but I'm not entirely certain of that.
Is there anything else that might allow the email to be sent? I'd even settle for a different plugin or a different mailserver. I'm setting this up for testing and demonstration purposes only.
AI: First of all you should not have posted the full log above. It contains your gmail username and password! So the very first thing to do is to change your gmail password.
Now to work on your problem:
If you are using 2factor auth, you will need to create an application password and use that to authenticate.
You will need to enable "insecure" apps as described at https://support.google.com/a/answer/6260879?hl=en (otherwise gmail will only allow access via their API but not via SMTP |
H: Parse out column with commas in it into separate rows
I have data in the following 2 column format in my google spreadsheet:
3M 701
A.W. Sperry DSA-2002
Accusplit 725MX, 705X, Magnum XL
I would like to be able to parse out the 2nd column by comma such that it looks like this:
3M 701
A.W. Sperry DSA-2002
Accusplit 725MX
Accusplit 705X
Accusplit Magnum XL
I'm a Java developer and can write a program to do this but was wondering if there is a way to do this right in google spreadsheets.
AI: I think the easiest way to do this right in Google Spreadsheet is to write a program: a custom function. Once a custom function is entered in Script editor (under Tools) it becomes available within the spreadsheet: thus, calling =columnSplit(A1:B3, 2, ",") on your array will return the desired output.
The custom function is briefly documented using jsDoc, this will be shown if you start typing its name in a cell. The first argument is the range to split, the second is the number of column (1,2,...) which is to be split, the last one is the delimiter. The function trims the output cells to eliminate stray spaces around commas.
/**
* Splits the array by commas in the column with given index, by given delimiter
* @param {A2:B20} reference Range reference
* @param {2} index Column index
* @param {","} delimiter Character by which to split
* @customfunction
*/
function columnSplit(reference, index, delimiter) {
var input = reference;
var output = [];
if (input.constructor !== Array) {
input = [[input]]; // support for single-cell range
}
for (var i = 0; i < input.length; i++) {
var parts = input[i][index - 1].toString().split(delimiter);
for (var j = 0; j < parts.length; j++) {
var copy = input[i].slice(0); // slice(0) to get a fresh copy of the row
copy[index - 1] = parts[j].trim(); // trimming is optional
output.push(copy);
}
}
return output
} |
H: Red padlock icon showing in Gmail From address
I noticed a red open padlock icon in Gmail near the From address part of an email message.
What does this red open padlock icon mean?
AI: This is part of a newly-announced bit of functionality to make Gmail more secure.
Gmail Blog: Making email safer for you
If you receive a message from, or are about to send a message to, someone whose email service doesn’t support TLS encryption, you’ll see a broken lock icon in the message.
In your particular case, you have received a message from someone whose email provider doesn't use encryption. This isn't necessarily something to be alarmed about, but if sensitive information is being passed back and forth you might wish to know about it.
This is what it looks like when you're sending a message to someone whose provider doesn't use encryption: |
H: Prevent promoted tweets on Twitter
I get "Promoted" tweets all the time on my Twitter feed and the majority of the time, they are just a nuisance as I've specifically selected accounts to follow and I feel like they are infringing on my feed on stuff I actually want to read. I know some have a "Dismiss" option but not all. Is there a way around this?
AI: I use the Stylebot plugin in Chrome to load some custom CSS for the Twitter site.
.promoted-tweet {
display: none;
}
That little bit of CSS will make all the promoted Tweets invisible. |
H: Find out which contact joined Twitter
When I get a message from Twitter saying that one of my contacts is now on the service, I get their Twitter handle but no other information. Very often people won't use their actual name or photo, and I can't figure out who it is. How can I find out which of my contacts is being referred to?
AI: The information available to you through Twitter will be only what that person has allowed to be shown on their profile, and it won't include their phone or email address (which Twitter likely used from your phone contacts to connect you two).
You could run a web search on their Twitter handle and see what related sites come up -- folks will often reuse names across different services and correlating those can provide you with enough context to figure it out.
... or, you could DM the user and ask who they are. |
H: A spreadsheet formula to assign letter grades based on numeric ranges
I'm trying to figure out how to write an IF statement that will be 'true' if a value is in-between two values.
Example:
If value is between 60 and 69.9 return "D"
If value is between 70 and 79.9 return "C"
If value is between 80 and 89.9 return "B"
I have this, but I can't figure out how to modify it so the test is an in-between instead of a less than or greater than.
=IF(A1<60, "F", IF(A1>60, "A", 0))
AI: Keep the inequality signs going in the same direction:
=IF(A1<60, "F", IF(A1<70, "D", IF(A1<80, "C", IF(A1<90, "B", "A"))))
The above works fine as long as there aren't too many cases. But if you had many options, C-,C+,B-,B+... it would be better to use a lookup table instead.
For example, if you have a lookup table such as the one below, then
=vlookup(A1, $K$1:$L$5)
does the same job as nested IFs. The table is also easier to maintain in case of changes: e.g., you decided to move some cutoffs.
+---+----+---+
| | K | L |
+---+----+---+
| 1 | 0 | F |
| 2 | 60 | D |
| 3 | 70 | C |
| 4 | 80 | B |
| 5 | 90 | A |
+---+----+---+ |
H: How to turn off dates and/or people in Facebook's "On This Day"?
Facebook's "On This Day" is an interesting way to surface things that I, or people who I'm friends with, have shared in the past. However, there are some memories that I'd rather not be surfaced. (A funeral, perhaps, or a friend with whom I've had a falling out.)
Is there a way to control which dates and/or people appear on "On This Day"? (I don't want to block people, nor avoid Facebook on a particular day.)
AI: Yes.
Go to https://www.facebook.com/onthisday
You should have two buttons in the upper right. Click "Preferences".
On the Preferences pane you can add dates and/or people that you would like to not appear in "On This Day".
The text on the Preferences pane says:
Your memories are yours, so you should control which ones you see in On This Day. Memories include things like your posts and others' posts you're tagged in, major life events and when you became friends with someone on Facebook. Use these filters to help make sure we show you memories from On This Day in a way that's meaningful for you.
If you want to keep from being reminded about "On This Day" altogether, click "Notifications", then "Off". |
H: Renew Google Drive share link
In our company we have some files on Google Drive which I share with different people using a share link. Company policy dictates that shares, passwords,... need to be changed regularly to decline access to employees who have been fired, left, retired and so on.
Right now, what I do is make a copy of these files, rename them and share the newly created copies.
However, this feels very devious and I can hardly believe there isn't a better way for this.
Stop sharing the file and then sharing it again leaves me with the same share link as before, so this isn't a solution.
So my question in short: What is the fastest way to change the share link of a file in Google Drive?
AI: There is no way to change the link of a file in Google Drive, but you could create set expirations dates. For details see Set expiration dates for access to Google Drive, Docs, Sheets, and Slides files
If you are using Google Apps for Work or other similar edition, share your files with people from the same domain, so when their accounts get suspended, they will lose the access to the files.
If you are using a consumer account, create a Google Groups group, add the people that you want to give access to the files as members, and share the files to the group's email address. Then, when someone leave the organization, remove that member from the group.
Another alternative is create a copy of the file which will have a new link, then you could unshare the old file.
Note: The copy will not include the change/version history and comments from the original. |
H: Can't send email on behalf of delegated email address
I have two Gmail accounts primary A and secondary B. I have delegated access to my Gmail account B for my account A. So from account A I can confirm that I can see my account B as delegated in the right top corner.
When I am clicking compose email from my account A I do not have an option to send on behalf of account B.
Is there any way to fix that?
AI: The behaviour you describe is as expected.
A delegated account allows you to easily switch to that account without logging out of your primary account. The delegated account is opened in a new window and you have "full" control to send/view/delete emails and contacts as the delegated account. However, the address books of both accounts are combined when composing an email and when sending email from the delegated account this is indicated with "(sent by Delegate)".
Reference:
https://support.google.com/mail/answer/138350?hl=en-GB
Account delegation doesn't allow you to send emails from the delegated accounts email address (B) from within the primary account (A) - you need to switch to the delegated account first.
If you wish to send mail using the delegated account's (B) email address, from within account A, then you could configure account B's email as a send mail as address. But, when you send email, it won't appear in account B's Sent Mail folder/label. |
H: Apply formatting and formulas to another sheet?
I have a template tab that contains all formulas and formatting. Then one tab for each user. I know how to reference cell content with =template!A1. How to reference formula that reference current tab? And how to reference formatting?
Link to my sheet
AI: Spreadsheet functions cannot access either formulas or formatting of other cells. (Script functions can, but that is another story).
It seems what you want to do is the duplicate your template sheet, so that new sheets will have the same formatting and formulas. There is an easy way to do this: "Duplicate" command in the context menu of the sheet.
This copies all values, formulas, and formatting.
However, if you think that the values in column B may be changed in the future, then you don't want them to be just copied to other sheets: you want references. To achieve this,
Duplicate "template" once, the new copy could be "user sheet". Edit the cells in B column of "user sheet" so they reference the template: =template!B5, and so on.
After that, duplicate only "user sheet", not the template sheet. The duplicates will have the same references =template!B5 in them. The "template" sheet could even be hidden, because you'll need it only on the occasion when the values need to be edited.
Aside on protection
Instead of telling users "only edit yellow cells", you can actually prevent them from editing other cells, by using sheet protection with exception of a given range:
However, protection does not get copied by the Duplicate command, so you would need to either add it manually to every sheet, or use a script for copying protections/permissions. |
H: Dropbox folder downloads as 'unspecified' file
I'm trying to download a folder from Dropbox. When I click download, all I get is a file called unspecified. Any idea why this happens?
AI: This happens when you have "too many" files in that folder.
From the Dropbox Help Center:
https://www.dropbox.com/en/help/49
Can I download entire folders on the Dropbox website?
Note: It's not possible to use the website to download an entire folder that's over 1 GB or that has over 10,000 files. If the folder is in your account, use the Dropbox desktop application to download the entire folder to your computer automatically.
A workaround that I've found is to simply download the directory in chunks, by selecting (click and shift+click) a block of files that is below this limit. |
H: Google Apps Script Exceeded maximum execution time
My code for an API pull has been timing out a lot lately. Here is my code (note that I have changed some variables for privacy):
// SHEET DATA
var ss = SpreadsheetApp.getActive();
var data_sheet = ss.getSheetByName('data');
var view_sheet = ss.getSheetByName('views');
var num_rows = view_sheet.getDataRange().getNumRows()
// API URL
var api_url = "url"
var api_url2 = "end of url"
// AUTH
var user = 'email'
var apikey = "apikey"
var token = user + "/token:" + apikey;
var encode = Utilities.base64Encode(token);
var params =
{
"method" : "get",
"headers" :
{
"Content-type":"application/xml",
"Authorization": "Basic " + encode
}
};
// calls the zendesk API for each view on the views tab, adds it's view count as a new row on the data sheet
function zdAPIcall() {
// for date formatting
var time = new Date();
var time_utc = new Date(time.getUTCFullYear(), time.getUTCMonth(), time.getUTCDate(), time.getUTCHours(), time.getUTCMinutes(), time.getUTCSeconds());
// loops through views on views tab (excluding header row)
for (i=2; i<=num_rows; i++) {
// pulls the view ID
var view_id = view_sheet.getRange(i, 1).getValue();
// builds the API URL
var full_api = api_url + view_id + api_url2;
// finds the last row to add the value to
var update_row = data_sheet.getLastRow() + 1;
// hits the zendesk api
var response = UrlFetchApp.fetch(full_api,
params);
// pulls the response as json, extracts the view count value
var json = response.getContentText();
var data = JSON.parse(json);
var view_count = data['view_count']['value']
// adds the data as a new row to the data sheet
data_sheet.getRange(update_row,1).setValue(time_utc)
data_sheet.getRange(update_row,2).setValue(view_id)
data_sheet.getRange(update_row,3).setValue(view_count)
Logger.log("row added!")
};
};
AI: It's better not to call setValue in a loop, but instead form a double array of values to be inserted, and put them all at once with setValues. This often helps with keeping resource use under quota.
However, in your case the main issue is not setValue but UrlFetchApp.fetch in a loop. Hitting some API a bunch of times in a loop is an expensive thing to do, both for your script and the API provider. The maximum execution time of Apps Script is 6 minutes, after which the script is terminated with the message you quoted. To avoid this, follow Anton Soradoi's advice:
Store the necessary information (i.e. like a loop counter) in a spreadsheet or another permanent store (i.e. ScriptProperties).
Have your script terminate every five minutes or so.
Set up a time driven trigger to run the script every five minutes(or create a trigger programmatically using the Script service).
On each run read the saved data from the permanent store you've used and continue to run the script from where it left off.
Terminating a script means recording the starting time start = Date.now(), and then checking in the loop whether you are running over 5 minutes (start+5*60*1000). If this happens, exit the loop (hence the script) but set a trigger to resume work in a few minutes. Since you already work with a spreadsheet and record the results there, it will not be difficult to find the place where the script should pick up the work after restart. |
H: Can people see if I read their LinkedIn message?
Do people I receive messages from on LinkedIn get a "read" receipt after I've opened their message?
AI: Now Read Receipts Indicators are available for iOS and Android. When read receipts is turned on, you can see whether your sent messages have been read or not.
Notes:
Read receipts and typing indicators are available initially only on mobile.
Your read receipts and typing indicators will not be visible to senders of InMails.
For more details see LinkedIn Help page: Using Read Receipts and Typing Indicators |
H: Duplicate and rename sheet in one action on Google Sheets
I have a script which references the name of a sheet in Google Spreadsheets. When I duplicate a sheet with a cell that uses that function, the function is called right away and returns something like Copy of Sheet1. When I rename Copy of Sheet1 to Sheet2, the function is not called again because the result is cached.
If I pass a parameter like Today() into the function and simply ignore it, the function will be recalculated every day but that is suboptimal for a couple of reasons:
I don't need to recalculate that formula every day. I will not be changing the name of the sheets, so I just need it to calculate once.
I would rather not wait an entire day for the formula to be calculated after duplicating a sheet.
What I would like to do is duplicate a sheet and give it a name before the formulas in the sheet are calculated. Is this possible? If so, how can it be done? If not, do you have any other suggestions?
AI: This can be done with a script, using insertSheet method which takes the new sheet name and the template after which it's to be created. The first function adds a custom menu item when the spreadsheet is opened, the second performs duplication when that menu item is invoked.
As far as I can tell, the contents are copied over in the same way as they are with "Duplicate" function.
function onOpen() {
var menu = [{name: "Duplicate and name", functionName: "dupName"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu("Custom", menu);
}
function dupName() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var name = Browser.inputBox('Enter new sheet name');
ss.insertSheet(name, {template: sheet});
} |
H: If I close my Gmail account will somebody be able to register my previous mail address?
If I close (is delete an option ?) my Gmail account, will somebody be able to register using my email address and read my mails?
I want to close my Gmail account but I don't want anybody to impersonate me with my old address.
Same question with Yahoo! Mail. Do they allow addresses to be re-used?
AI: No, Google does not recycle email addresses.
Google...has confirmed to Webwereld that it does not recycle unused accounts. Users can delete their accounts, but this "won't free up your username. Once you delete your Gmail address, you won't be able to use that same username (username@gmail.com) in the future," Google says on its site.
(source)
Yahoo! Mail does, however, delete inactive email accounts and makes the usernames available for new people. However, they claim that they have ways to keep people from using this to impersonate the previous account holders. For instance, they have an agreement with Facebook to prevent a newly-acquired address from being able to access an older Facebook account.
That said, deleted accounts are not available right away and any of the email messages that you'd deleted would still be long gone. The real risk is of future email messages meant for you being sent to someone else. |
H: Is it possible to use the contents of a cell in a custom conditional formatting rule in Google Sheets?
For example, given the sheet below:
I'd like the background colours of columns B-D to change automatically when I update the values in column A
Is that possible? I'm looking for a solution that will work with any colour, without preprogramming the sheet in some way to be aware of a fixed set of colours.
AI: Going to answer this one as the answer from the post: "Google Spreadsheets conditional formatting based on another cell's content" is outdated.
To answer your question: Highlight the Range that you need conditional formatting, then go to "Format > Conditional Formatting" and for each Color you will add a unique conditional format.
Apply to Range: the range you selected previously
Format Cells if: "custom formula"
Formula in plain English: Anything in the corresponding cell in column A on the same Row that contains the characters "Red", the formula would be:
=A:A="Red"
And then just choose red background from the color picker in the conditional formatting sidebar.
Repeat this process for each color.
Example file here: https://docs.google.com/spreadsheets/d/1sJtSrvFpKxmxUgzvrtIQzhYmxqeoR0FWVHpzNV5bIgQ/edit?usp=sharing |
H: Search text in all columns of multiple sheets
Given many texts to look for, I want to search all my sheets in all columns if there's at least one partial case insensitive match then return true (or 1 or the sheet's name or whatever) and false otherwhise...
I didnt go far, I tried the following which searches one col in the next sheet (just one, yet to make it search in all of them):
=IF(FIND(A1,sheet1!A2:A1000)>0,"true","false")
I'm getting:
Error
An array value could not be found.
All suggestions/solutions are welcome to solve my whole problem as explained at the start
AI: You need search (case-insensitive) instead of find (case-sensitive). Also, a few wrappers around it:
=max(arrayformula(iferror(search(A1, sheet1!A1:A1000)))) > 0
iferror ensures empty output instead of #N/A when the cell is empty or text cannot be found
arrayformula specifies that we work with an array
max returns the maximum (so it will be positive if at least one cell matched)
Comparison >0 will return TRUE or FALSE; no if statement needed.
The above works for multiple columns at once: you can use sheet1!A1:Z1000 and so on.
The results from multiple sheets can be pooled together by addition prior to comparison:
=max(arrayformula(iferror(search(A1, sheet1!A1:Z1000)))) + max(arrayformula(iferror(search(A1, sheet2!A1:Z1000)))) > 0 |
H: If my rows are sparse, is there an alternative representation?
I'm making a perk calculator. Architecturally I have a sheet with perks, and another sheet where the user can select a set of perks and can see in a "results" cell their total effect.
Examples for perks: "5% armor". "10% damage", "2% armor and if you get hit you become invulnerable for a second". If all of these are selected, the result should be "7% armor, 10% damage, if you get hit you become invulnerable for a second". Naively all perks could be represented as strings, but in that case adding up similar effects (5% armor + 2% armor = 7%) would require a heavy and unmaintainable string-manipulation function.
I've barely used spreadsheets until now, and my understanding is that the natural way to represent this is to have columns for every effect that may need to be summed, so that the cells themselves can contain simple integers.
|perkName |armorBonus|damageBonus|special |
|perkOne | 5 | | |
|perkTwo | | 10 | |
|perkThree| 2 | | invulnerability blabla|
Because the perks can actually have way more effects than just these two, this creates very sparse data, rows with dozens of columns where only one or two contain data.
Is there an alternative, better way to handle this? Or is this how it is done by people with actual experience?
AI: You can fold a sparse table into a 3-column table where first column is perk name (repeated for each effect), the second is effect, and the third is the amount (or something).
+---+-----------+---------+--------------+
| | A | B | C |
+---+-----------+---------+--------------+
| 1 | perkOne | armor | 5 |
| 2 | perkTwo | damage | 10 |
| 3 | perkTwo | health | -1 |
| 4 | perkThree | special | invisibility |
| 5 | perkThree | armor | 2 |
| 6 | perkThree | stamina | 5 |
+---+-----------+---------+--------------+
This can be easily filtered down to relevant values using filter. For example:
=sum(filter(C1:C, (B1:B="armor")*((A1:A="perkOne")+(A1:A="perkTwo")+(A1:A="perkThree"))))
returns 7, as it filters column C to the values where:
(B = "armor") AND (A = "perkOne" OR A = "perkTwo" OR A = "perkThree")
Naturally, these strings can be references to cells with chosen perks. One can use sum to take OR over an array of perks, etc.
For special (text) values you'll need join rather than sum.
To make column A easier to enter, you can pre-fill it with the formula A2 =A1, dragged down the column. Then every entered perk name is duplicated down, until you replace it with another perk's name. |
H: How to add current date to cell if the rest of the cells (or some cells) in that row are edited, but only the first time?
I have a column A4:A (heading = Date), and other columns after it B4:O.
I want column A to fill in today's date automatically when I fill in any other columns (some of these B4:O maybe empty, but most will be filled) in that row. But I only want that to happen the first time I edit any other columns within that row.
What I've tried:
A7: =IF(B7 > 0,TODAY(),)
AI: This question is similar to Is there any way to create a timestamp in a Google Spreadsheet? except here you want to date of the first edit, not the most recent one.
This cannot be achieved with spreadsheet formulas, because if a formula inserts today's date subject to some condition (nonempty cells), it will also insert tomorrow's date tomorrow, if the condition still holds.
This can be done manually, by pressing Ctrl; (Control/Command and semicolon) in Column A after making the first edit to a row.
Or this can be done automatically by a script.
Such as this one, which inserts the date of first edit to a row in the first column of that row. The date is inserted in ISO format yyyy-MM-dd. (It can be any other format supported by SimpleDateFormat.)
function onEdit(e) {
var row = e.range.getRow();
var dateCell = e.range.getSheet().getRange(row, 1);
if (!dateCell.getValue()) {
dateCell.setValue(new Date()).setNumberFormat("yyyy-MM-dd");
}
}
The script should be entered in Tools > Script Editor. It runs automatically on every edit, but it will not replace the date in column A if it's already there.
To have a script recording the date of last edit, change it
function onEdit(e) {
var row = e.range.getRow();
var dateCell = e.range.getSheet().getRange(row, 1);
dateCell.setValue(new Date()).setNumberFormat("yyyy-MM-dd");
} |
H: How to sum up values from last Monday to Now?
I have a column that totals earning, B4:B, which sums up all values, however, I just want it to total values from last (most recent) Monday to Now, until it's Monday again, start over, the date column is A4:A.
I've tried;
=SUMIF(A4:A,">="&(DATEDIF(ARRAYFORMULA(A4:A),TODAY(),"D"),B4:C)")))")
AI: =sumif(A4:A,">" & (today()-weekday(today(),3)),B4:B)
where weekday(today(),3) gives you the weekday where Monday = 0 and Sunday = 6 |
H: Can I set the number format to show exactly 2 decimals only when needed in Google Spreadsheet?
I want to set the number format as below:
If the number have more than 2 decimals, round it to 2 only (e.g. 12.3456 -> 12.35).
If the number is whole number, just let it be (e.g. 12 -> 12).
AI: Using the custom number format 0.## achieves most of what you want: the insignificant 0s will not appear after the decimal dot. However, the decimal dot itself will appear, as it's a part of the format. So, you'll have 12.3456 appearing as 12.35 and 12 appearing as 12. (with the dot).
In a way, this trailing dot is a feature because otherwise, 12.001 would be rendered simply as 12 (without dot) which can be misleading in some contexts. The trailing decimal dot is customarily kept to indicate that some rounding may have taken place.
I don't think it's possible to get rid of the trailing dot without a script. (In Excel, conditional formatting can be used for this, but the conditional formatting in Google Sheets does not support applying date/number formats: only colors and such.)
If you really want to get rid of the dot, here is a script for that (put in Tools > Script Editor):
function onEdit(e) {
if (e.value == Math.floor(e.value)) {
e.range.setNumberFormat("");
}
else {
e.range.setNumberFormat("0.##");
}
}
Note this formats everything in the spreadsheet as it's edited. You may want to be more restrictive, e.g.,
function onEdit(e) {
if (e.range.getSheet().getSheetName() == 'Sheet1' && e.range.getColumn() == 2 && e.range.getRow() >= 2) {
if (e.value == Math.floor(e.value)) {
e.range.setNumberFormat("");
}
else {
e.range.setNumberFormat("0.##");
}
}
}
This formats only the second column of Sheet1, beginning with the second row.
By the way: 0.## vs #.## is a matter of taste: I prefer 0.75 to .75, not omitting the 0 in front. |
H: See Amazon shipment cost without disclosing personal information
Why does Amazon.com require me to enter my financial information before letting me see shipment costs?
Attaching some screenshots for those who do not believe.
AI: Log out of your account and delete all amazon.com cookies.
Then, add the item to your cart (you can do this without logging in), and click on "estimate your shipping and tax". They only require your location to do this: |
H: Create a symmetric matrix in Google Sheets
So, I'm working on a project in Google Sheets that has me creating a symmetric matrix. I've filled one half of it with the correct values, but I'm not happy with the idea that I have to reinput the same data (or cell references) by hand on the other half.
Is there either an option that will do this for me, or a way to otherwise automate the process? I know about paste transpose, but that gives me the same chart, with the empty half below rather than above, and still no way to get the data into the other half. I suppose I'd also accept a way to combine the two sheets, putting the filled values from one into the empty values from the other, or some sort of "transparent" paste where an empty cell in the pasted range doesn't overwrite the data in the cell it's pasted over.
Screenshot of what is filled in so far:
AI: The following formula refers to the transpose of the current cell:
=indirect("R"&column()&"C"&row(), False)
Indeed, it takes the row and column numbers of the current cell and swaps them to get a cell reference in R1C1 format.
However, having to paste this in every row of upper-half of the matrix separately is not appealing. (One can't select a triangular region to put the formula in). So here is a better way:
Suppose your current matrix is in the sheet named "matrix". In cell A1 of another sheet, enter
=if(isblank(matrix!A1), indirect("matrix!R"&column()&"C"&row(), False), matrix!A1)
and extend this formula to a square region the size of the matrix. You get a symmetric matrix in that sheet: the formula takes either the matching cell in sheet "matrix" or its transpose, whichever is nonempty. Then select the matrix and copy values only (Ctrl-Shift-V) back into the original sheet.
Alternatively (if you don't want to mess with Indirect, maybe because your matrix is off-center and you'd need some adjustments to row/column numbers), use three sheets: one for lower half matrix, one for its transpose, and one more to combine them:
=if(isblank(matrix!A1), transpose!A1, matrix!A1) |
H: SUM function not working for cells with formulas in Google Sheets
A B
----------------------
TOTAL =SUM(B3:B)
Entry1 =IF($A3="Entry1","20",IF($A3="Entry2","170", IF($A3="Entry3","10")))
Entry2 =IF($A4="Entry1","20",IF($A4="Entry2","170", IF($A4="Entry3","10")))
Entry3 =IF($A5="Entry1","20",IF($A5="Entry2","170", IF($A5="Entry3","10")))
The values in column B are properly displayed (respectively "20", "170" and "10"). But the SUM function in B2 returns 0... why?
AI: Just unquote your numbers like this:
=IF($A3="Entry1",20,IF($A3="Entry2",170, IF($A3="Entry3",10)))
Otherwise it treats the numbers like text. |
H: Alternate Background Colours, Conditional Formatting Based on Date?
I have a date column, A7:A, I wanted rows to be coloured every other week, A7:A may have duplicate dates but I want all the dates that lie on the same week to be one colour and alternate so it's easier to read? Week would start from Monday to Sunday.
I've tried: Conditional Formatting → Custom Formula → =WEEKDAY(A7:A, 2) > 0
AI: If every week is represented (i.e., the dates are not skipping any weeks), then conditional formatting with the custom formula =isodd(weeknum(A7, 2)) does the job. (=iseven(weeknum(A7, 2)) works too, naturally.)
The second argument 2 is needed because your weeks are Monday-Sunday. If it's not included, weeknum uses Sunday-Saturday weeks.
If there may be some gaps, use conditional formatting with custom formula
=isodd(countunique(arrayformula(weeknum($A$7:$A7, 2))))
That is, count the number of different weeks represented in the column so far, and format if this number is odd.
As usual, the formatting is applied to the entire range such as A7:P at once; the formulas stated above will be correctly interpreted for the cells below A7, using relative references. |
H: Formula based on cell positions from target cell
I have a spreadsheet that I use to keep track of my paid time off (PTO). I accrue a certain number of hours each pay period (which I know in advance). When I take some time off, I add a row and keep a running total.
The data typically looks something like this:
A B C D
+--------------------------------------
1|Date Accr Used Balance
2|start 20
3|Jan-7 4 24
4|Jan-12 8 16
5|Jan-21 4 20
6|Jan-28 4 16
7|Feb-4 4 8 12
8|Feb-18 4 16
9|Mar-3 4 20
The formula to calculate the balance is essentially: take the previous balance, add any accrued hours, and subtract any used hours. So the formula in D3 is =D2+B3-C3, in D4 it's =D3+B4-C4, etc. (I do it this way because sometimes I take time off on the same day that I accrue it. I only want one row per date with activity.)
When I go to add some time off, I generally insert a row for the date when I'm taking the time (for instance, if I'm taking time off on February 22, I'd insert a row between rows 8 and 9). Unfortunately, that causes the formula in row 10 (the former row 9) to change to =D8+B10-C10. This isn't the end of the world, because I can just auto-fill from the rows above (again). However, sometimes I'm adding a record using the Google Sheets Android app, and it's not easy to do auto-fill on that.
I was wondering if I could tweak the formula so that insertion of a row wouldn't cause it to adjust like that.
I do know that I can use $ to prevent references from changing, but I'd need to do that for every cell, and that's even more work.
Can I create a formula that does the following?
{cell above} + {cell two to the left} - {cell one to the left}
AI: The command offset does what you want: =offset(D3, -1, -2) is the value 1 row above and two columns to the left of D3. So, your formula for D3 could be
=offset(D3,-1,0) + offset(D3,0,-2) - offset(D3,0,-1)
Extended down the column, it will do the intended computations regardless of row insertions. |
H: Conditionally format data in spreadsheet column, but only when it changes
Say I have this data in a Google Spreadsheet:
cat
cat
mouse
mouse
mouse
cat
dog
dog
And I only want to apply conditional formatting to the ones in brackets [] (so I can hide them but still calculate with them)
cat
[cat]
mouse
[mouse]
[mouse]
cat
dog
[dog]
How do I do it? Merging cells won't work because the data needs to be entered line by line and I don't see the option in conditional formatting or when searching around the web.
AI: Assume that the data is the column A and start on row 2,
Select the data
Click on menu Format > Conditional formatting
On the Conditional formatting rules side panel, go to Format cell if and select "Custom formula"
Add the following formula
=A2=A1
Click on the Done button. |
H: How to get value of adjacent cell based on key, if the table is split into multiple columns
I need some help figuring out some Google Sheets function. I'm trying to look for the value of an adjacent cell based on a key. The problem is that the table has several rows and columns to search for. For example:
| A | B | C | D |
1 | Alpha | 5 | Bravo | 10 |
2 | Charlie | 15 | Delta | 20 |
The list goes on for several more rows and columns. What I'm looking for for example, is when I use "Delta" as my search key, it will return the value 20 for me.
AI: You can still use vlookup for this, by stacking the lookup tables into one using the array notation {first ; second; third} which means first above second above third. Example:
=vlookup("Delta", {A:B; C:D}, 2, False)
returns 20. |
H: Find slope/intercept of last 30 values entered?
I have a column A7:A that has numbers from 1+;
I have another column B7:B, that has dates from Oct 31st, 2015 +;
I have a column F7:F that has weight values;
I have a goal weight of 108.36297798;
I need to find on what date from today will I reach my goal weight, but I only want to count values from the last 30 days on and not everything. This means that some dates may be empty but I want last 30 available values to be counted, so if it's empty go back until there's 30 values.
So far I've tried;
=DATEVALUE(TODAY() + ((108.36297798)-(INTERCEPT(F7:F,A7:A)))/(SLOPE(F7:F,A7:A)))
this just returns all the values, I want only last 30?
AI: The command
=query(A7:F, "select A, F where F is not null order by A desc limit 30")
returns the last 30 values where F is nonempty. If this command is placed, say, in G1, then it fills the array G1:H30, to which you can then refer:
=DATEVALUE(TODAY() + ((108.36297798)-(INTERCEPT(H1:H30, G1:G30)))/(SLOPE(H1:H30, G1:G30)))
In principle, one can avoid creating a helper array and have just one formula returning the result. This requires replacing the references to A with
=query(A7:F, "select A where F is not null order by A desc limit 30")
and the references to F with
=query(A7:F, "select F where F is not null order by A desc limit 30")
The result is kind of long and scary but it works.
=DATEVALUE(TODAY() + ((108.36297798)-(INTERCEPT(query(A7:F, "select F where F is not null order by A desc limit 30"), query(A7:F, "select A where F is not null order by A desc limit 30"))))/(SLOPE(query(A7:F, "select F where F is not null order by A desc limit 30"), query(A7:F, "select A where F is not null order by A desc limit 30")))) |
H: How to find visit stats for one page on Wikipedia
How can I find how many people have visited one specific page on Wikipedia?
AI: You could use the pageview API or this graphical tool built on top of it. |
H: Display Google Docs in Compact View
Apparently, there is a way to view a Google Docs document as one long scrolling page (like a web page), instead of the antiquated default with separate pages. It is called Compact View, and it actually used to be the default view.
Currently, I can't find how to enable it. This Google Support page seems to imply it is tied to the "Compact Controls" setting, but I think someone at Google got confused about the similar names and made a mess of that page.
AI: Answer
To toggle between the view that shows the break pages and the one that hide them, on a Google document click on View > Print layout .
The following snapshot shows a document having two pages with the print layout turned off:
An alternative method to turn off the print layout view is to double click on the space between pages
Remarks
There are several ways to submit feedback to Google,
Use the feeback form at the bottom of referred help article
On a Google document, click on Help > Report a problem
Post your feedback at the Google Docs Help Forum |
H: Using two values from one column to fill another column and repeat the calculation
I'm trying to work out how far I travel on a tank of petrol. I've set a column to display the mileage at the time I enter the petrol station, and I want to display the difference between the two values in the next column.
Example:
Mileage is in column F and tank mileage is in column G.
I can get it to calculate the one tank, but I want Column G to auto calculate the tank mileage each time I add to the Total Mileage column.
This is how far I've got. located in Cell G3
=ARRAYFORMULA(IF(F3:F,(F3-F2:F),""))
It subtracts the value in F3 from the value in F2 to show me how many miles I've travelled on one tank of fuel. But I can't figure out how to make it work more than once.
I hope I'm making sense, I've been self-teaching myself Google Sheets all week and thanks to this site I've come this far. I'm probably over-engineering it.
Any help would be appreciated.
AI: Short answer
=ARRAYFORMULA(IF(F3:F,(F3:F-F2:F),""))
Explanation
Both parameters of a subtraction operation should be arrays in order to return an array. |
H: How to update values from another cell only once, not with subsequent edits?
I have a cell A1, whose values I change periodically.
I have a cell F7:F, I add values to this column from time to time.
I have another cell K7:K whose values depend on what's in A1 and what's in F7:F.
K7=(F7)/(A1*15) --just an example using row 7, K7 would only be filled once there's a value in F7.
However, I only want K7:K's values to change the first time, depending on what's in A1 that time, once I change A1 again, I only want the future values of K7 to change.
What I've tried:
I have a column J7:J, I put in values that I'd be putting in A1, but I'd like to get rid of this cell.
AI: I had to use script editor:
function onEdit(e) {
var row = e.range.getRow();
var dateCell = e.range.getSheet().getRange(row, 10);
if (!dateCell.getValue()) {
var distance = e.range.getSheet().getRange(row, 6).getValue();
var A1 = e.range.getSheet().getRange(1, 1).getValue();
dateCell.setValue(-(distance*A1/(15)));
}
} |
H: Is it possible to create unlisted (but public) boards in Trello?
Is it possible to create a public Trello board, but only allow those with the link to view it (i.e., it does not show up in Search Engines)?
The need here is to have a somewhat private board (without sensitive information, but not applicable to the outside world), but reduce the friction from requiring every single stakeholder interested in the board to need to create an account and sign in every time.
This is similar to YouTube's unlisted option:
Trello has the following privacy options:
Can you add a robots tag to a public board?
AI: You can expose a read only view of a private board through trello.link, a third party application built by a Trello Dev using the Trello API .
Although, the functionality is somewhat limited compared to a full board. |
H: Google Spreadsheet Query blanks out text cells in the query range
When I perform a query to essentially filter a range of names, and times, any cell that is not a time gets blanked out. Screenshot of example:
I'm keeping this post fairly short since the image succinctly describes the problem. Whats causing this, and how do I correct it?
AI: QUERY result assigns a data type to each column. The "blanked out cells" occurs because their data type is not compatible with the data type of the resulting column.
Instead of QUERY use FILTER.
To learn more about QUERY see https://support.google.com/docs/answer/3093343?hl=en and
https://developers.google.com/chart/interactive/docs/querylanguage. |
H: Google Spreadsheet Conditional Formatting depending on up to 7 Fields
I'm trying to color a column depending on the row. My table looks like this:
the only thing i managed to do was =NOT(ISBLANK(C101:C104)) and set it to orange using the conditional formatting.
I would like to have green if everything or everything but D:D is filled out, orange as soon as C is given and red as soon as C is missing. Any ideas how to do this? I tried:
=((NOT(ISBLANK(D42:D142)))AND(NOT(ISBLANK(F42:F142)))AND(NOT(ISBLANK(G42:G142)))AND(NOT(ISBLANK(H42:H142))))
as a conditional formatting formula for green but that didn't work.
yellow should be:
=NOT(ISBLANK(D42:D142))
and red:
=ISBLANK(D42:D142)
still I don't know which rule is applied first.
AI: FORMULAS:
RED:
=if(And(COUNTA(B42:H42)>1,isblank(D42)),true,false)
YELLOW
=if(and(istext(D42),(Or(isblank(B42),isblank(C42),isblank(E42),isblank(F42),isblank(H42)))),true,false)
GREEN
=if(counta(B42:H42)=7,true,false) |
H: How can one auto create pre-filled URLs with registered addresses from a roster
We use google forms to send out tests to our students. We have a spreadsheet with rosters where we keep the info of the students (email, birthday, gender, guardian etc) for every class in our school. One roster per sheet. After we finalize and approve a form we immediately link the form to a Responses spreadsheet.
We wonder whether we could (from the existing roster spreadsheet) automate the following workflow:
Create and fill-in with one of the email addresses, a single option checkbox question. This could be the first question of the form.
Generate a pre-filled link of the form with the above mentioned email address from the roster.
Append the generated pre-filled link to the Responses spreadsheet.
Rotate the process through all emails in the roster so we end up with a column of the links.
Related
How can we NOT record, but on the fly disregard responses not matching an already existing roster
Show URL used to edit responses from a Google Form in a Google Spreadsheet by using a script
Can I auto-fill an answer on a form edit URL?
AI: Short answer
Yes, it's possible to automate the workflow but with slight changes. This answer assumes that the OP is using a consumer account instead of a Google Apps for Work of Google Apps for Education account.
Explanation
First Step
Create and fill-in with one of the email addresses, a single option checkbox question. This could be the first question of the form.
REMARK: If you want that to use a unique option to prevent that the student change it, then you will need to create a new form for each student. To automate this you will need to use Google Apps Script or an add-on. This was left out of this answer as it will make it too long for the Q&A model of this site.
Checkboxes are used to allow multiple option selection, radio buttons are used to allow to select only one option but both will show all the email addresses and this could take a lot of space. Instead of using a checkbox/radio button, consider to use a dropdown list as the list of all email address will be displayed only when the user click the dropdown button.
If the list has hundreds of email addresses, instead of a dropdown use text question to make the form load faster.
Second Step
Generate a pre-filled link of the form with the above mentioned email address from the roster.
Pre-filled links use URL parameters with special ID for each question. To keep the things simple, get the link from the form at least to take on URL to be used as template.
To get the link to be used as template follow the instructions of Prepopulate form answers - Google docs editors Help
Third step
Append the generated pre-filled link to the Responses spreadsheet.
Assuming that the OP is referring to the roster spreadsheet, add a column to hold the pre-filled URL for each student.
For a form with two questions, one for the email address and pre-filled, the pre-filled URL will look like the following
https://docs.google.com/forms/d/form_id/viewform?entry.29450426=name@example.com
The form id will look like the following
1awKpg_diniayS6360kNXrcgihk36azQ3DJEaZqXDY7A
The pre-filled email field will look like the following:
entry.29450426=name@example.com
The part between entry. and = could be different for each form, and obviously the email could be anyone as in this step the purpose is to find the URL to be used as template.
Forth step
Rotate the process through all emails in the roster so we end up with a column of the links.
REMARK: In the automation terminology, instead of "rotation" the term used is "iteration" but also could be referred to this kind of task as "doing a loop" or "looping through...".
There are several ways to automate this. You could use formulas, Google Apps Script and Add-ons.
Using a formula.
In this step, the pre-filled URL corresponding to each student will be generated.
In the roster spreadsheet, assuming that the first row holds the column headers and the column B holds the student email addresses, in the new column add the following formula in the cell in the second row
="https://docs.google.com/forms/d/form_id/viewform?entry.29450426="&B2
Then fill down as necessary.
REMARKS:
The following formula will fill the required cells, but it requires that the there aren't data below the students data range.
=FILTER(
"https://docs.google.com/forms/d/form_id/viewform?entry.29450426="&B2:B,
LEN(B2:B)
)
Using add-ons
I don't think that there is an add-on that implement the whole workflow, so it's very likely that could be necessary to use several or to mix formulas, scripts and add-ons.
One of the add-ons that could be helpful is FormMule. It's a very popular addon among teachers that could be used to send the pre-filled form URL that correspond to each student.
FormMule - Google+ Community
FormMule - Addon
Using Google Apps Script (GAS)
As this could require a very long explanation for someone that doesn't know the basic this be excluded of this answer. |
H: How to change "other names" in my Google Plus basic info
I want to change "other names" in Google Plus other info
but there is no link to do it
AI: Make sure you're logged in to your Google Account. Go to your profile in "Classic" G+.
"View profile as yourself".
Click the "About" tab.
Scroll down until you see the "Basic Information" block.
Click "Edit".
Save when you're done. |
H: Google Drive (Sheets) shared file - move ownership - different domains
I'm helping my daughter with her project and started an example of how to create a table using Google Sheets, which I shared with her. She continued on with it but now I want to remove it from my Google Drive and let her have it permanently.
Is there a built-in way to do that?
Something like I release my ownership to her and then I remove the file entry in my Drive but she now owns the file?
Or does she have to download the file and upload it to her account to make it permanently hers?
Edit:
I can't transfer ownership, but if the file is shared and I remove the file from my Drive, on the other user's "Drive", they will get a message stating the owner deleted the shared file, it will soon be gone and to make a copy. A button to copy is provided.
If you are on the same domain, the information at the link works fine. I tested that.
AI: Google does not like to transfer ownership between domains. Without domains or within the same domain you could transfer without issue.
You can publish the document and append /copy to the shared file URL that will prompt the user to copy it to their drive regardless of domain.
So a URL like https://docs.google.com/spreadsheets/d/1Lrq5sbr-Q_8TFky81OSMFgTO1OnQ8bbN1G05m0q3dVQ/
becomes https://docs.google.com/spreadsheets/d/1Lrq5sbr-Q_8TFky81OSMFgTO1OnQ8bbN1G05m0q3dVQ/copy |
H: Cut an uploaded YouTube video
I uploaded a video to YouTube and now I want to cut it shorter using the YouTube Editor without having to save repost it as a new video.
Is this possible?
AI: Yeah, it's simple enough.
Go here https://www.youtube.com/enhance?v=[Your video ID]
Go to "trim".
Use the slider to change it as required.
Save changes (not save as new video).
Wait approx 30 minutes and it should have updated. |
H: An arrayformula to find the previous non-empty cell in another column and find the last row to work with
I would like to do something similar to what was solved in the question:
An arrayformula to find the previous non-empty cell in another column
The problem was:
If I have a column "input", I would like the column "ouput" to be filled with the preceding value of the "input" column.
input - ouput
a a
a
a
b b
b
b
b
c c
c
c
c
It was a great answer, however, the ArrayFormula works with an user-specified range:
=ArrayFormula(vlookup(ROW(1:10),{IF(LEN(A1:A10)>0,ROW(1:10),""),A1:A10},2))
How would I make the function to automatically get the last row that it has to take?
Specifically, I would like to know how to get automatically the number 10 of the last function.
I have tried to use INDIRECT but it finds an error.
=ArrayFormula(vlookup(ROW(INDIRECT("B3:B"&INDEX(SORT(B:B,ROW(B:B),FALSE),1))),{IF(LEN(INDIRECT("B3:B"&INDEX(SORT(B:B,ROW(B:B),FALSE),1))>0,ROW(INDIRECT("3:"&INDEX(SORT(B:B,ROW(B:B),FALSE),1)),""),INDIRECT("B3:B"&INDEX(SORT(B:B,ROW(B:B),FALSE),1)},2)))))
This part: INDIRECT("B3:B"&INDEX(SORT(B:B,ROW(B:B),FALSE),1))
is used to get the last value of a column.
I have created a spreadsheet with the functions:
https://docs.google.com/spreadsheets/d/15jbXZbixRYxJSRQuKgBU8BWN6KYNjwwT5PzvYp986Ww/edit#gid=0
Any help would be appreciated.
AI: Can't edit your spreadsheet, but this formula (entered in C3)
=ArrayFormula(if(row(B3:B) <= max(if(not(isblank(B3:B)), row(B3:B))),vlookup(row(B3:B),filter({row(B3:B),B3:B},len(B3:B)),2),))
should bring you the output you expected. |
H: How can I make the sidebar appear by default in a custom Google Maps?
I would like to have the sidebar shown by default in the new version of the custom Google Maps. Is there any way to achieve this?
AI: I cannot find the link now, but am certain that I've read (on a Google help site or similar) this is controlled by the screen-width of the device of the person who is looking at the map - effectively meaning that you cannot control it. |
H: How do I concatenate data from multiple columns on one sheet into a single column on another sheet?
I need to take separate columns containing first and last names on one spreadsheet, and combine them into a single column on a different sheet. Right now my formula is
=CONCATENATE(IMPORTRANGE("URL", "A1:A3"), " ", IMPORTRANGE("URL", "B1:B3"))
What I would want is to get a single column of
First1 Last1
First2 Last2
First3 Last3
But instead I am getting
First1First2First3 Last1Last2Last3
Because the second argument in the IMPORTRANGE function is a string, I can't just direct it to one cell and then drag the function over multiple cells like I normally would when concatenating. Is there a way to accomplish what I want without copying multiple data sets into one spreadsheet and working from there?
AI: This can be done with an arrayformula as follows:
=arrayformula(importrange("URL", "A1:A3") & " " & importrange("URL", "B1:B3"))
The inner part describes what should be done within one row; the arrayformula then says "do it for every row". |
H: Force keyword in Google search result
I know this answer is covered already but it does not seem to be working for me. How to force Google to use a keyword?
I would like to search Google and force it to return results about MotionBuilder. As you can see by the screenshot provided I have put it in double brackets like the other question has suggested. Google has ignored this however and most of the results are about Maya. Some of them are to do with motion builder but other search terms will return entirely maya results. I would like to ignore any results that do not contain the word "MotionBuilder"
AI: I suggest that your results do contain the term you've put in quotes. It's just not displaying in the list of results. Go to the page and check. (And if you still don't see it it's entirely possible that it has been removed since the Google bot visited the page and/or people are using that keyword in their links to that content.)
If you're finding your search results are containing content you don't want, use the "negation" or "exclude" operator, which is simply a minus sign in front of the term you want to keep out of your search. For instance, if I wanted to find information about pyramids not built in Egypt, I might search for
"pyramid" -egypt -pharoah
In your specific case, since you want to find "MotionBuilder", but not "Maya", your search might look like:
"motionbuilder" -maya python scripting poly count
More information at Google Search Operators |
H: RSS feed for specific tags on medium.com?
I just want to know how to create RSS feed for specific tags on Medium.com, like I'm interested in 'technology' posts on medium.com and I want to follow them via Feedly or Inoreader. How can I do that?
AI: You can get the RSS feed for any tag by any author using the URL in this format:
https://medium.com/feed/tag/technology
However, there's no mention of this at Medium Support. There they only mention feeds for @usernames and publications.
Medium feeds also appear to be just excerpts, not full feeds. |
H: Date search criteria in entries page in Cognito Forms
I’m trying to enable a date related search filter in entries page and I keep getting this error message:
value is not properly formatted
Since I use a simple expression (date is...or date is before...), I suppose this is a glitch.
Is this the case? Or am I doing something wrong?
AI: My name is Parker, I'm a developer with Cognito Forms. The date based searches on the Entries page must be in the US based format, regardless of the localization settings of the form. Unfortunately, for certain date/time formats the date picker control on the search criteria dialog does not handle this properly.
We are currently working on a fix for this, in the meantime you can switch over to the Advanced Editor for the search criteria and enter a valid US date and the search should work as expected. |
H: Broken link for Google NGrams when an apostrophe is involved
If I do a search for "Bartholomew's day massacre" from https://books.google.com/ngrams, I get to https://books.google.com/ngrams/graph?content=Bartholomew%27s+day+massacre&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t1%3B%2CBartholomew%20%27s%20day%20massacre%3B%2Cc0.
If I copy that into my web browser, I am told
No valid ngrams to plot!
Ngrams not found: Bartholomew 's day massacre, [Bartholomew 's day massacre]
How can I avoid this?
AI: After some testing, the following works:
https://books.google.com/ngrams/graph?content=Bartholomew's+day+massacre&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=
It appears you need to remove the direct_url parameter. Actually, your original link works. You just have to select the text box and press Enter. This might be a temporary bug. |
H: How to update Google "My Maps" when Spreadsheet data changes?
In the process of building a Google My Maps map, I found that it's quite handy to import spreadsheets from your Google Drive to use it as a source for your map layers. As using spreadsheets is pretty much the only option to add data to your map, I assumed that the map would update whenever I add new data to the spreadsheet. I just can't find the option to update from the source/spreadsheet. The idea that this was possible has its origins in …
Reading "updated" in the "The Walking Dead Map" and other custom maps
The reason that a spreadsheet is a must-have to get data into the map
Now I can only see that I have something like a Google Fusion Table after importing the data (once), but no real link to the original data, so no Spreadsheet-as-Database behind it, only one directional route to go. As far as I can see, the original spreadsheet could simply be empty (aside from the headline) as well and I could add the data than in the data table in Google Maps. Adding data to the spreadsheet does do nothing to the data in Maps so far. The same goes for adding data to the data table in Maps, which updates nothing in the Spreadsheet.
The help pages do not offer really any help on that topic as they only explain the "move data into maps" process and have nothing covering updates.
Questions: Is there a way (or a reasonable workaround) to update the my-maps-data/layer-data from the spreadsheet? Or can I update the spreadsheet from the data table in Maps?
AI: The answer is simple: It does not work. This is a one-way route.
What does work, is the other direction. Treating Google My Maps as simple map builder application works without a problem and offers a nice and simple user interface for people contributing data to any application that relies on having KML files as a dataset. On top of that, My Maps allows exporting a "Network Link" KML file (Keyhole, Inc. Markup Language file).
As it currently stands (Google tends to rework the UI often enough to render this info useless in a couple of months), you can click the 3 dots icon in the "add layer" and "share" bar in the left-hand menu. From there, select "Export KML" and then check both checkboxes. The resulting file will be the "network link" KML file.
That network link KML file can be uploaded to for e.g. Google Drive and then gets constant updates (with a 10-minute delay) from what users altered in the My Maps layers.
ProTip:
When uploading to Google Drive, you must share the KML file publicly. Best is to add a publicly shared kml folder and store your files there.
When using the share Url, you have to take the ID you get from this Url and use a different Url. You have to use googledrive.com/host with the ID:
// Original Google Drive Share Url:
https://drive.google.com/file/d/{KML_FILE_ID}
// Hosted KML file to use in your application:
https://googledrive.com/host/{KML_FILE_ID}
Also, keep the limits for KML Layers in mind. |
H: How do I add co-hosts to my page's event?
I manage a Facebook Page which organizes events now and then. One event is being organized together with a different Page, managed by different people. I would like to set up Facebook to register both Pages as the event hosts. So that both can invite their fans and such. How do I do this?
I already found the canonical Facebook answer to this question, but somehow I do not see the co-host option anywhere...?
AI: It turns out that it is relatively easy, as long as you remember one thing that Facebook does not mention:
Use Facebook as your personal you!
Summarizing all steps:
Use the full desktop interface, no app
Create the event, published or not
Make sure to use Facebook as your personal you: click the down triangle at the top right and click your human name, not the Page's name
Find the event
Edit it
At Co-Hosts, add any person you know managing the other Page
Ask that person to follow the same steps (instead of creating the event s/he should attend it)
Ask that person to add the other Page as co-host
The event will now automatically be shown on the other Page's list of events. Anyone managing the other Page can now invite their fans.
Both Pages will be shown as organizers, at least sometimes. In some situations however, only the 'relevant' Page is shown: the one the user happens to like.
Note that Page events can have persons as co-hosts, but not the other way around: personal events can only have persons as co-hosts. |
H: Can I use the IRR formula without listing out each investment?
Let's say I've invested ₹1 in a mutual fund every month for the last 88 months, with a resulting corpus of ₹236.
I want to find the annualised rate of return using the IRR formula. To do so, I have to list 1 88 times, from A1 to A88, then enter -236 in AB9, and in A90 enter =IRR(A1:A89).
Is there a way I can tell the IRR formula to assume the same amount invested 88 times rather than listing it out 88 times? Or is there some other formula that is a special case of IRR and works simpler for this case?
This is in Google Sheets.
AI: To avoid listing 1 88 times, you can use 1+0*row(1:88) within arrayformula:
=IRR(arrayformula({1+0*row(1:88); -236}))
I'm leaving aside the issue of how this aligns with IRR documentation (which says that the first amount must be negative), and the fact that in my spreadsheet the above formula returns an error "IRR attempted to compute the internal rate of return for a series of cash flows, but was unable to." |
H: How to block automatic row and column insertion in Google Sheets?
While playing around with array formulas, "sometimes" when the result has more rows and columns than the previously available in the sheet, Google Sheets automatically adds the row needed. I said "sometimes" because I don't figured out yet why sometimes Google Sheets automatically add new rows but other times don't.
To make things worst, like when using MMULT with open ended references (A:A), the recalculation time takes minutes.
Let say that I have a formula with open ended references like the following
=ARRAYFORMULA(MMULT(N(ROW(A2:A)>=TRANSPOSE(ROW(A2:A))),SIGN(ROW(A2:A))))
If the sheet has 5,000 rows the result should have 25,000,000 cells. Sometimes it just returns the following error message:
Error
The resulting array was too large.
Other times, Google Sheets add a lot of rows, and the recalculation time could take minutes.
Besides using close ended references (A1:A10) instead of open ended references(A:A), Is there a way to tell to Google Sheets to do not insert rows or columns?
AI: Short answer
Use ARRAY_CONSTRAIN(array,row_limit,column_limit)
Explanation
ARRAY_CONSTRAIN function could return the number of rows and columns that you want, just set the row_limit and column_limit parameters accordingly. To automatically set this parameters you could use a function like COUNT or COUNTA.
To calculate the number of rows/columns considering the data range by using built-in functions,
for rows use a formula like the following
=MAX(IF(LEN(A2:A)>0,ROW(A2:A)-1,0))
for columns use a formula like the following
=MAX(IF(LEN(1:1)>0,COLUMN(1:1)-1,0))
The sample formula in the question will look like the following:
=ARRAYFORMULA(
ARRAY_CONSTRAIN(
MMULT(N(ROW(A2:A)>=TRANSPOSE(ROW(A2:A))),SIGN(ROW(A2:A))),
MAX(IF(LEN(A2:A)>0,ROW(A2:A)-1,0)),
MAX(IF(LEN(1:1)>0,COLUMN(1:1)-1,0))
)
) |
H: Can I trigger a Google Apps Script with a HTTP POST?
I've been looking through all sorts of info about Script and haven't really found anything in regards to triggering a script with a HTTP POST. I'm looking to send one or two POST requests per hour to the script, have the script make a couple changes to the data in the requests, and then POST to somewhere else. The closest thing I found was running a script at set intervals (e.g. hourly) -- I can modify what I'm trying to do to work with that, but it'd be easier if I could just POST to the script and be done with it.
Is this something Google Apps Script is capable of?
AI: Yes, you can trigger an Apps Script function with an HTTPS POST request. You'll need to add a doPost() function to a script file. The doPost() function can also receive data from the POST request. If you want to receive data into the doPost() function, add a variable name inside of the parenthesis:
doPost(e) {
// . . code here . .
};
The documentation typically shows a variable named e inside of the parenthesis, but you can use any name that you want.
If you need to send a POST request from an Apps Script function, you can use:
UrlFetchApp.fetch()
The default type of request is a GET request, so you will need to use advanced options, and explicitly designate a POST request.
Google Apps Script Documentation - UrlFetchApp.fetch()
In order for the Apps Script project to be available, it must be published. In the script editor, click the "Publish" menu, and choose "Deploy as Web App". There are two versions of a Web App, the development version, and the "production" version. The development version has "dev" on the end of the URL. The production version has "exec" on the end of the URL.
The "exec" version of the Apps Script URL is what you must use for the URL in your POST request to your Apps Script project.
If you want to return something from the Apps Script web app, then you must use Content Service.
You can get more information from the following Stack Overflow post:
Call a custom GAS function from an external URL |
H: Using Spotify Web Player behind proxy
Spotify Web Player https://play.spotify.com does not work behind my company proxy. Is there a way to use Spotify Web Player when behind a company proxy?
AI: Try using this URL instead (adds ?http=1):
https://play.spotify.com/?http=1 |
H: What's the formula to select a range excluding a sub-range?
I want to say A1:A60 excluding A20:A30. Is there a minus operator for use with ranges, in Google Sheets?
I know that you can take the union of two ranges, like {A1:A19;A31:A60}. I would like to know if there's an operator that excludes one range from another.
AI: With the following formula it is possible to exclude a certain range:
=ARRAYFORMULA(QUERY({ROW(A1:A60), A1:A60}, "SELECT Col2 WHERE Col1<20 OR Col1>30")) |
H: Search videos on Facebook
How can I search videos on Facebook like we search on YouTube?
AI: You can look via URL at https://www.facebook.com/search/videos/?q=fish
which will give you videos on Facebook about fish.
Alternately, just do a search and choose video from the tabs. |
H: Is there an easy way to undo changes to a cell, column or sheet within a spreadsheet?
In Google Sheets, I may sometimes edit a cell, then edit another cell, and then decide that I want to undo the first edit.
Is that possible?
This also goes for rows, columns, sheets with a spreadsheet, ranges, etc.
AI: No, edits can be undone only in the reverse chronological order: most recent one, then the one before it, etc.
In the situation you described, the easiest solution is to undo the last two edits (Ctrl-Z twice), copy the cell or range of interest, redo the edits (Ctrl-Y twice), and paste back into that cell/range.
To go further in time, you can use revision history (accessed by clicking "all changes saved in Drive", or from the menu). One cannot copy directly from revision snapshots, but you can restore some revision, copy a range of cell, go back to latest revision (which is now second-latest) and paste. |
H: Partial match for strings that are truncated beyond 30 characters
I have two sheets. Sheet one has a list of events in column N: "IEM Katowice", and others. However, our system imports event names that are longer than 30 letters (including spaces) with a .. at the end (e.g. CEVO Gfinity Professional Seas..).
Sheet two contains two columns, A which has the full name for all Online events and B which has the full name for all LAN events. For example, "IEM Katowice" would be in column B, while "CEVO Gfinity Professional Season 9" would be in column A.
I am trying to make column U of sheet one find the partial match for column E (the event) to any event in column A and B. Based on which column it finds the partial match in it would then say LAN or Online in the cell in column U.
I have been playing with MATCH formulas and others such as:
=ARRAYFORMULA(IFERROR(IF(VLOOKUP(N:N,Format!B:B,{1}*SIGN(ROW(N:N)),0)=N:N,"LAN",""),""))
AI: You want to test the equality of the first 30 characters of each string. The command left can be used for this:
=arrayformula(if(iserror(vlookup(left(N:N, 30), left(Format!B:B,30), 1, False)), "that", "this"))
The formula returns "this" if there is a match in column B, and "that" otherwise. |
H: Concatenate several columns into one in Google Sheets
I want to concatenate/combine columns A, B and C into column D as displayed.
The number of filled entries in A, B and C will vary over time, so absolute cell addresses cannot be used.
What formula could I put into D1 to fill the column as illustrated?
AI: You need to filter down to non-empty cells, and then stack the results together:
={filter(A:A, len(A:A)); filter(B:B, len(B:B)); filter(C:C, len(C:C))}
This is the same as this answer by grayob which is unfortunately buried under outdated answers. |
H: How can I set a Google Forms survey to read-only?
I finished the collection of responses through a Google Form. Now I want to set the survey to read-only, i.e. allowing people to view the form but not submit any more responses.
AI: You could potentially trick the user with form data validation though its kind of mean as it would still invite them to try and answer but if you set the validation to require something totally obscure they could never really answer it.
If you simply no longer want to receive responses you can disable them and the form will no longer accept responses. Under the Responses tab the first line "acccepting responses" click that and it will disable your form. (Users will not see it then.) |
H: How do I get Google Sheets to display lakhs correctly?
I would like Google Sheets to format 1,00,000 as I wrote it, and not as 100,000. How do I do that? I tried the following number formats mentioned I found via Googling, and none of them work:
##,###
##,##0
#,##,##0.0
What's the right format? And what do the symbols in this string mean, anyway?
AI: From the answer by Adam Starrh on Stack Overflow, pointed out by w3dk:
[>9999999]##\,##\,##\,##0;[>99999]##\,##\,##0;##,##0
correctly formats integers up to 99,99,99,999. Here's an explanation:
0 means a digit that has to be there, even if it's an insignificant 0.
# means a digit that only appears when it's significant.
Concerning separating commas, the only thing Google Sheets care about is whether you want them, not where you want them. If the number is 1000000 and the format is ####### there are no commas; if the format is #####,## (for example), then the commas are inserted in traditional places: 1,000,000.
So, the workaround used above is to escape commas with backslashes, so they are treated as regular characters. This allows one to place them manually. The downside of manual placement is that one has to keep track of how many digits the number has and adjust the number of commas accordingly. This is why there are three different formats above:
##\,##\,##\,##0 for numbers >9999999
##\,##\,## for numbers >99999
##,##0 for numbers 0-99999
If you need numbers greater than 999999999, add another condition in front:
[>999999999]##\,##\,##\,##\,##0; (rest as before) |
H: In Google Spreadsheets, how do I make a cell display a value randomly depending on a percentage in another cell
I want to make a cell display the word, 'YES' and 'NO' where the chance of the cell landing on'YES' would depend on the % in another cell.
(E.g. 100% would mean there is a 100% chance on the cell landing on 'YES', 99% would mean a 99% chance on cell landing on 'YES', etc)
AI: Simple. Let's say the chance is 0.6 (60%), then =rand()<0.6 would have ~60% chance of being TRUE. I tested 100 functions on both Excel and Google Spreadsheet and confirmed the result.
There are two ways of showing "YES"/"NO". One is using if(). Another is =(rand()<0.6)*1 which forces the result into number 0 or 1, then using custom number format of "YES";;"NO";@ |
H: How to enable desktop notifications for Gmail
I'm using Gmail. I'd like to receive desktop notification for every new email.
How can I receive these notifications?
AI: You have to turn Desktop Notifications on for new emails from your Gmail Settings.
From https://support.google.com/mail/answer/1075549?hl=en :
Turn desktop notifications on or off
Open Gmail.
In the top-right corner, click the gear icon Settings.
Select Settings.
Scroll down to the Desktop Notifications section (stay in the "General" tab).
Choose one of the options:
New mail notifications on: If you use inbox categories, you’ll only be notified about messages in Primary.
Important mail notifications on: You’ll be notified about every incoming messages marked as important. Learn more about importance
ranking.
Mail notifications off
Click Save Changes at the bottom of the page. |
H: Is it possible to directly delete a file forever in Google Drive?
I would like to directly "delete forever" a file in Google Drive. Is this possible?
In doing so, I want to avoid the extra step of deleting the file from the Trash can.
AI: From what I can see, there is no way to delete something from Google Drive without it first going into the Trash and for you to delete it from there permanently.
There are plenty of people on the Google Drive Help Forum complaining about this.
Then again, it seems that there are nearly as many people complaining that they can't recover a file that they said to "delete permanently", so I suppose Google is splitting the difference. |
H: How can I unfollow everyone at once on Twitter?
Instead of manually unfollowing everyone by clicking on "Unfollow", is there a way to automatically unfollow everyone on Twitter?
AI: If you want to unfollow everyone on your Twitter account you have to use some third-party applications like Twitter unfollow (Chrome Extension) or alternatively through Chrome or FF Developer Tools.
Using Chrome Extension
Twitter unfollow (Chrome Extension)
Using Chrome Developer Tools
There is also another smart and easy way of bulk unfollowing at once on Twitter using Chrome or FF Developer Tools
Open https://twitter.com/following
Scroll to bottom until all users that you follow are loaded (important)
Right-click on an empty area > Inspection
After opening Developer Tools press ESC once to open the Console (if needed)
In the Console box type the following code and press enter
$('.button-text.unfollow-text').trigger('click')
Voila ! Every single "Following" button now has been magically clicked like you had one thousand mouse clicks at once turning off all of your "Following"s |
H: Boolean values not calculated by =SUM()
I'm trying to use a Google Spreadsheets template called "multiple person expense sharing template"
It seems there is some possible incompatibility with it. I think the template has become incompatible with newer versions of Google Docs. Boolean values are correctly shown but somehow =SUM does not give the correct value if put in a separate cell (eg true=1, false=0). This breaks the template.
The functions which seem to affect it are on the "splits" tab
=AND(LEN(D$1)>0,ISNUMBER(SEARCH(D$1,'raw data'!$E5)))
This equals to TRUE/FALSE
which is expected to be calculated as 1 by the number of people splitting function
=SUM(D4:AA4)
however it remains at zero
I managed to get the function to work by using extra INT() which gives the integer value of the boolean function..
=INT(AND(LEN(D$1)>0,ISNUMBER(SEARCH(D$1,'raw data'!$E5))))
=This equals to 1/0
This seems a bit counter intuitive however. I can't see doing anything wrong and the incompatibility of the template is the only thing I came up with.
AI: I ended up using
=SUMPRODUCT(D4:AA4)
I still cannot think of a reason better than incompatibility with older Google Spreadsheets. As Sally suggested, this could or should be regarded as a bug.
However when playing around with different functions in Google Spreadsheets, I came across the SUMPRODUCT function. It allowed me to modify only the SUM function. Thus it was the easiest solution for this problem as I didn't have to replace a much larger amount of Boolean functions in all columns with the integer converting INT function. Rubén's suggestion =ARRAYFORMULA(SUM(N(D4:AA4))) also worked. For this case the added complexity was not necessary. I'm not advanced enough to comment on the use of SUMPRODUCT in all cases; It might not be a solution for everything. |
H: Prioritize a website in Google Search results when you are searching for something
Everyone knows Stack Exchange is the best (that's why you are reading this).
Let's say that I want Stack Exchange website to be always the first in my Google search results whenever I search for something, how can I do this?
AI: I decided to use search parameter by url instead like so:
google.com/search?q=hello+world+as_sitesearch=stackexchange.com
And just link it to the omnibox search engine parameter.
I know it isn't the actual answer to my question but it solved my problem. |
H: Allow view access to a Google Calendar only from certain point in time
I'd like to share my Google Calendar with a colleague, giving him access to view/read all event details which aren't set to Private.
Can I specify that he only be allowed to view events starting 01-01-2016 and into the future, but none of the events before that date?
AI: No, I'm afraid not. If you're going to share a calendar, the whole calendar gets shared.
The only thing I can think to do to perhaps create a second calendar that you can move all of your old events to. Bulk-moving events from one calendar to another is not an insignificant problem, though.
Alternatively, you can create a second calendar and share that with your colleague. You'll just need to remember to add the events that you want to share to that calendar. |
H: Custom defaut scale and more on an html export of a diagram
When I export a diagram as html file, is it a way to specify a custom scale of the diagram at the open of the windows (e.g. to fit window)?
Is there any documentation about the embed-static.min.js script embeded in the html file generated?
AI: You can't do this from within draw.io without writing a plugin. But it can be done as a post process.
You will need to add a 'viewBox' attribute to the SVG that draw.io has created. This allows the SVG to be scaled proportionally with CSS like a normal img. And you need to add some basic CSS to limit the SVG to 100% width.
I used one of the standard templates to test this, so I didn't get 'embed-static.min.js'. My file had 'embed.js'. I don't know what difference that makes.
After the 'embed.js' but before the closing </body> tag, add the following:
<style>
/* edit both the mxgraph class and naked svg inside */
div.mxgraph {
max-width: 100%;
}
div.mxgraph svg {
width: 100%;
min-width: 100% !important; /* or whatever you need to override the default */
}
</style>
<script>
var svg1 = document.getElementsByTagName("svg")[0]; // Get the first <svg> element in the document
var att = document.createAttribute("viewBox"); // Create a "viewBox" attribute
att.value = "0 0 1122 662"; // Set the value of the viewBox attribute
svg1.setAttributeNode(att);
</script>
Where the javascript sets the 'viewBox' with att.value = "0 0 1122 662"; 0 0 starts us in the top-left of the svg container. 1122 is the unscaled width needed to display the full svg, and 662 is the height. This is what provides the aspect ratio.
I had to do a lot of digging through draw.io's g+ support page to find anything on this. But, Julian Moore seems to have done a faire amount of examples.
Also, there are a couple plugin examples that show how to take advantage of the mxGraph API in draw.io.
A nice intro to the topic here. (Although, it's weirdly titled "Visio Alternative", the post outlines plugin install, and provides an example to play around with.)
Worth looking at if you have to adapt something for a production setup.
Edit:
This answer assumes you were trying to limit the Draw.io diagram to the page. So, the provided example scales down the SVG so no scrollbars are visible and the entire diagram is visible. |
H: What's taking CPU time in a Google Sheet?
I have a complex Google Sheet, and the gray bar on the top right takes a long time to complete. Is there a way to see what the sheet is calculating to pinpoint down what part of the sheet is taking up the CPU time?
AI: No, there is no CPU profiler provided by Sheets. The following may help locate the issue:
Make a copy of the spreadsheet
"Freeze" some of its calculated values (select a range, press Ctrl-C, then Ctrl-Shift-V, overwriting formulas with static values).
Observe the effect on the performance of the spreadsheet.
Repeat for a different group of formulas. |
H: Google script match values from a column in one sheet to a column in another sheet
I'm trying to filter two columns in Google Spreadsheets, say A in sheet 1 (which contains work order numbers) and A in sheet 2 (which contains the same strings of work order numbers but they are hyperlinks). I'm trying to compare the values in both columns and match every work order with a hyperlink named the same. So if sheet 1 cell A3 has "1234" and sheet 2 column A2 has hyperlink "1234", filter the hyperlink to sheet 1 cell R3 to be on the same row as the work order.
I'm currently able to do this in a crude way where I copy a filter formula to all cells in target as in:
=IFERROR(FILTER({'SHEET 2'!A$2:A},('SHEET 2'!A$2:A) = ('SHEET 1'!A3)),"")
=IFERROR(FILTER({'SHEET 2'!A$2:A},('SHEET 2'!A$2:A) = ('SHEET 1'!A4)),"")
That works but this does not work:
=IFERROR(FILTER({'SHEET 2'!A$2:A},('SHEET 2'!A$2:A) = ('SHEET 1'!A3:A)),"")
If it worked it could have helped me match all hyperlinks to work orders with only one filter function in the first cell.
Otherwise now I'm trying to implement it in Google script so that I don't have a formula copied on all hundreds of rows. I have this so far, but it's not working. It runs for several minutes and only returns a few random 1, 0 and undefined before I cancel it because it's taking too long.
function shop_traveler_filter(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("SHEET 1");
var maxrow = sheet.getMaxRows();
//var vals = sheet.getRange(3,1,maxrow,1).getValues();
var sheet2 = ss.getSheetByName("SHEET 2");
var maxrow2 = sheet2.getMaxRows();
//var vals2 = sheet2.getRange(2,1,maxrow2,1).getValues();
for (var i = 3; i < maxrow; i++) {
var values = sheet.getRange(i,1).getValue();
for (var j = 2; j < maxrow2; j++) {
var values2 = sheet2.getRange(j,1).getValue();
if (values[i] == values2[j]) {
sheet.getRange(i,18).setValue(values2[j]);
}
}
}
}
How to get this right?
AI: Your task is better described as matching or lookup rather than filtering: you want at most one entry to be returned. This can be efficiently done with vlookup
=arrayformula(iferror(vlookup('SHEET 1'!A2:A, 'SHEET 2'A2:A, 1, False)))
This looks up every element of 'SHEET 1'!A2:A in the column 'SHEET 2'A2:A and returns what is found. The arrayformula part ensures that everything is handled at once.
You may still run into performance problems, in which case you should either get rid of any empty rows at the bottom of the sheet (they are being looked up, too) or to filter out the blanks. That is, replace:
'SHEET 1'!A2:A with filter('SHEET 1'!A2:A, len('SHEET 1'!A2:A))
'SHEET 2'!A2:A with filter('SHEET 2'!A2:A, len('SHEET 2'!A2:A))
I'll add some remarks on the script, although I haven't studied it much.
Use getLastRow() instead of getMaxRows(), so that the loop runs only over the rows with data. Same for columns.
Do not call setValue in a loop. Instead, store the values you want to insert in a suitable array output, and after the loop call setValues(output). You can see such an example here. |
H: Can I add two calculated fields to a Google Spreadsheet based on a Google Form?
I am new to Google Scripts and am hoping for some guidance on improving a manual process I complete in Google Sheets.
To analyse the data I receive on a Google Form I run, I manually add-in (or copy down) two calculated identifier fields, which I use for a series of Index-Match formulas.
As new rows are inserted automatically when a new form is submitted, I have to keep dragging these formulas down the page for all new responses, just to update my tables.
The first identifier field is called "Week Number". This field returns a number representing the calendar week of a date selected in the form by the respondent.
- i.e.: in cell F100, the formula is =WEEKNUM(C100)-6) : The first week of the project was the 6th week of the year.
The second identifier field is called "WeekName", which is a concatenation of two fields, the "Week Number" and the Name of the respondent, as selected from the form.
- i.e.: in cell G100, the formula is =B100&F100 : whereby the Name data comes from the second column (first form field after Timestamp).
I have looked at basic script iterations of getValue and setValue, but can't figure out how to apply that logic to the logic I use in my formulas.
Any tips?
AI: Short answer
There is no need of scripts. Instead use the built-in arrays handling features of Google Sheets.
Explanation
Google Sheets can handle arrays and automatically expand them. There are some functions like SUMPRODUCT, MMULT, FILTER and QUERY that return arrays but other functions require to be used together with ARRAYFORMULA.
Not all the functions could work with ARRAYFORMULA or will return an array of values. Below are the array formulas that should work for the cases exposed in the question.
Examples
Add the following formulas to row 2.
=ArrayFormula(WEEKNUM(FILTER(C2:C,ISNUMBER(C2:C)))-6)
=ArrayFormula(FILTER(B2:B&F2:F,LEN(B2:B)) |
H: Google Sheets: how to resolve emails to user names
We have a Google Apps account for our organization. When you create a Google Form using your Apps account, there is a helpful option to have the form capture the user's email address when the form is submitted. Now, it shows up like this in the resulting spreadsheet:
Timestamp Username Question 1
3/11/2016 22:28:18 username@domain.com Option 1
However, I'm trying to find a way resolve that email address to a user's first and last name. It would be helpful if there were a formula, or a Google Scripts script, that could add another column that has the user's real name, resolved from the email address. Does anyone know if this is possible?
AI: There isn't a built-in function but there is ad advanced Google Apps Script service ->
Admin SDK Directory Service
From the above link:
Get user
This sample gets a user by their email address and logs all of their
data as a JSON string.
function getUser() {
var userEmail = 'liz@example.com';
var user = AdminDirectory.Users.get(userEmail);
Logger.log('User data:\n%s', JSON.stringify(user, null, 2));
} |
H: Sort Column but keep associated value in Google Sheets
I have an Google Sheets spreadsheet that looks something like this:
|Team #|Rank|
| 100 | 4 |
| 200 | 3 |
| 234 | 6 |
I want to sort the teams by Rank, from best to worst, and then assign them a place (1st, 2nd, 3rd) based off of this rank. Basically, I need to move the data, but keep Team# and Rank coupled together. Example:
|Place|Team #|Rank|
| 1 | 234 | 6 |
| 2 | 100 | 4 |
| 3 | 200 | 3 |
But I need to do this in a formula because this information updates constantly (based on the output from other formulas).
How do I sort from highest to lowest in Rank but keep the associated Team #? I need to keep them together in order to score teams.
AI: If the Team and Rank columns are B and C, then you need the formula
=sort(B2:C, 2, False)
which sorts columns B and C according to the second one (C), in descending order (False). Note that the output of sort cannot overwrite the data in place. It has to be placed elsewhere, e.g., on a another sheet named "sorted". |
H: Is there a difference between the gmail Inbox site and Chrome extension?
Google Inbox is now generally available without any invites. However, the Chrome Inbox App is still alive and maintained (last version was February 9th).
Does the Chrome extension provide any extra features that do not exist in the inbox web site?
AI: Short answer
There is no difference at all.
Explanation
The screenshot doesn't correspond to an extension. Please note that the right up corner only display the "Visit website" button but not the "Add to Chrome" button. The screenshot it's about the Inbox by Gmail directory/catalog entry about in the Chrome Web Store.
At this time the Chrome Web Store include four categories apps, games, extensions and themes and two types Chrome apps and websites. |
H: What does 'X min read' mean on Medium?
What does "2 min read", "1 min read" mean on Medium?
AI: "An estimate of how long it will take you to read that story (in minutes)."
Source: Read Time - Medium |
H: ImportXML data reloading every time I open the sheet
I have a problem with my Google Sheets updating the IMPORTXML data every time I open my sheet.
Does importxml function run every time I open Google Sheets? Is there a way of turning off this? I don't want it to refresh data every time I open the sheet.
Surely there must be a way of controlling when the update must be done.
AI: I don't think there is a built-in way to disable automatic updates of importXML, but here is a workaround. Enter the script given below in the Script Editor. It will add a new menu item, Custom > Update imported data, next time the spreadsheet is opened.
Place any importXML formulas in the first row of a sheet and precede them with a backtick, so they are not recognized immediately:
`=importXML("http://cnn.com", "//div")
This doesn't do anything on its own. But when the command "Update imported data" is executed, it will place the actual formula (without backtick) one row below, so it is executed. After that, it will replace all formulas on the sheet with their output; in particular there will not be any active importXML formula left. The original backticked formula will stay in place, so the data can be refreshed again just by using the same menu item.
function onOpen() {
var menu = [{name: "Update imported data", functionName: "update"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu("Custom", menu);
}
function update() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getDataRange();
range.offset(1, 0).clear();
var values = range.getValues()[0];
for (var j=0; j<values.length; j++) {
if (/^`=import/i.test(values[j])) {
range.getCell(1, j+1).offset(1, 0).setFormula(values[j].slice(1));
}
}
SpreadsheetApp.flush();
var range = sheet.getDataRange().offset(1, 0);
range.copyTo(range, {contentsOnly: true});
}
Limitations
When updating the output, the script erases everything below the first row, to make room for new data. So you can't have much else on this sheet, other than importXML. Put the rest of logic on other sheets.
Alternatively, one can modify the script to keep the first N rows unaffected, and use the rows starting with N+1 for imported data. |
H: How to restrict a Google Script to a certain cell range?
I'm working in an automatic script that shows the last modified dates of some cells within a sheet. So far, I've succeed with the sheet restriction adding an if condition, but I want to restrict this to a certain cell range (e.g., C3:W26). Do you know how I can do it?
This is my script:
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
var r = s.getActiveCell();
if( s.getName() == "Estado Paises" ) { //checks that we're on the correct sheet
if( r.getColumn() != 2 ) { //checks the column
var row = r.getRow();
var time = new Date();
time = Utilities.formatDate(time, "GMT-03:00", "dd/MM/yy");
SpreadsheetApp.getActiveSheet().getRange('X' + row.toString()).setValue(time);
};
};
};
AI: A fairly readable way of stating the condition of cell r being in a range is
var range = s.getRange("C3:W26");
if (r.getRow() >= range.getRow() && r.getRow() <= range.getLastRow() && r.getColumn() >= range.getColumn() && r.getColumn() <= range.getLastColumn()) {
// do something
}
One could also hardcode the row/column boundaries, but this is not as easy to modify later, especially if your range is something like U2:BB8. |
H: How to write an IF-formula with multiple OR/AND arguments to detect duplicates?
Update2: Changing all commas (,) to semicolons (;) gives me "Could not find a matrix value."
Update1: The formula that Rubén suggests:
=IF(COUNTIF($A$2:A&$B$2:B&$C$2:$C,A2&B2&C2)+COUNTIF($A$2:A&$D$2:D&$E$2:D,A2&D2&E2)>0,1,0)
Gets me this error. Any suggestions?
I have a Google sheet with 100 rows (individuals) and the following columns:
NAME (A) BIRTHDAY (B) BIRTHPLACE (C) TIME OF DEATH (D) PLACE OF DEATH (E)
I would like to create a formula in a new column (F) that outputs the value 1 if a person has the same NAME, BIRTHDAY and BIRTHPLACE or NAME, TIME OF DEATH and PLACE OF DEATH. Otherwise the output value should be 0.
Is this possible and if yes, how?
AI: Assuming that the first row is used for column headers, add the following formula to F2
=ArrayFormula(
IF(
OR(
COUNTIF($A$2:A&$B$2:B&$C$2:C,A2&B2&C2)>1,
COUNTIF($A$2:A&$D$2:D&$E$2:E,A2&D2&E2)>1
)
,1
,0
)
)
Then fill down the above formula as necessary |
H: How to use INDIRECT inside an IMPORTRANGE function?
I need help to dynamically fetch a value from another Google spreadsheet like this: FILE1 has 0 or 1 values in column G. Now I want to fetch the G column value from FILE1 with a row number specified in B7 in FILE2.
I've learned that INDIRECT could solve the dynamic bit fetching from column G with B7 as row number like this:
=INDIRECT("G"&B7)
but I just can't make it work together with IMPORTRANGE:
=IMPORTRANGE("KEY";indirect("Sheet1!G")&B7)
=IMPORTRANGE("KEY", "Sheet1!G"; indirect(&B7))
Above examples just give me wrong interpretation of formula error. Is this possible to achieve with Google Sheets and if yes, how?
AI: The second argument of importrange must be a string, not a cell reference. The command indirect takes a string and returns a cell reference, which is not what you need. Just use
=IMPORTRANGE("KEY"; "Sheet1!G"&B7)
To clarify the difference:
Strings: "B4", "Sheet1!A3", "Sheet1!A"&E2
Cell references: B4, indirect("Sheet1!A3"), indirect("Sheet1!A"&E2) |
H: Google sheets formula to countunique rows with a condition
I have a sheet where I keep track of some expenses. the data is formatted like this:
Vendor A | Plumbing | $250
Vendor B | Cleaning |
Vendor A | Cleaning | $19
Vendor C | Washing | $20
| |
....
I want to count the number of unique vendors in the table where the 3rd column is greater than 0.
I tried =COUNTUNIQUE(C:C), but that counts the unique values of all the entries, even those where the value on column C is blank or 0.
AI: You should filter the values before counting uniques:
=countunique(filter(A:A, C:C>0)) |
H: Unhide "Likes" on Facebook
Accidentally I hid the "Likes" on Facebook. All "Likes" disappeared. Does anyone know how to unhide them? Couldn't find anything on settings.
AI: Click on your name on the Facebook bar at the top of the page.
Move your mouse over where it says More on the menu bar to the right of your profile photo. This will show a dropdown list of sections.
Click Manage Sections.
A new Manage Sections popup window will appear on the page. Click the checkbox to the left of where it says Likes to unhide it.
You can optionally drag the Likes menu entry up or down to reorder it.
Click the Save button to save the changes. |
H: Set global "export to PDF" settings for Google Sheets
I'm an Aussie. Google Drive is obviously built for USA first. Each time I export a Google Sheets as a PDF, I have to change the page size from Letter to A4, and other such settings.
Is there a way to set the settings Globally?
AI: Answer
Google Sheets doesn't have a global setting for paper size, only Google Documents.
From the reference
Note: Page setup is not available in Google Sheets.
References
Change the page setup of a document - Google Docs editors Help |
H: Can't log into freenode
I'm trying to use ChatZilla on Ubuntu with freenode but cannot login. I get a message that I am not using a valid command. I have not used my nickname in several months but some of the messages that came back indicate it is still registered.
I used the command /msg nickserv nickname password. So say my nickname was 'joe' and my password were '123456', I put in /msg nickserv joe 123456 and I get back:
from(joe) 123456
to(NickServ) joe 123456
from(NickServ) Invalid command. Use /msg NickServ help for a command listing.
AI: Your command is bad. If you want to identify to NickServ, the command is /msg nickserv identify (password), registering is /msg nickserv register (password) (email)
"Joe" is not a valid command :) |
H: Google+ +1 tab missing - where do I find what pages I have given +1?
I want to know what pages I have given a +1 in Google+.
Previously I could see this in the +1 tab on my Google+ profile.
The help still describes this as the place to look
However, I can no longer find any +1 tab on my Google+ profile. It now just displays my "interests" and my posts. I cannot find any complete list of the pages that I have given +1.
Where can I find this information?
AI: It appears that that information is no longer accessible through a link on Google+ since the recent redesign.
In order to view your previous "+1's" through a link, you'll have to go Back to classic G+. You'll find a link in the lower left on the menu, which will take you back to your old-style profile which will show +1's as a menu item.
You can also go directly to your +1's through this link: https://plus.google.com/me/plusones (you'll need to be logged in)
How long either of these remains available is unknown. |
H: Conditional moving average: the last two weeks or over 10 data points
I am looking for a formula to generate a moving average of the last two weeks OR the last 10 data points (whichever produces more data points) conditional upon the presence of data in two other columns. Example.
I want to calculate:
The average of column $K for the past two weeks (from today's date) OR the past ten data points (whichever is a larger data set) when column $G=HenkkyG and column $U=LAN.
Effectively I want Player HenkkyG's average over the past two weeks or 10 games (data points).
I am currently using this formula for overall average:
=IFERROR(AVERAGEIF($G:$G,AF2,$K:$K))
where AF2=player name I am drawing data for.
AI: This can be done with a few filter commands.
To filter by columns G and U:
=filter(B2:K, (G2:G = "HenkkyG") * (U2:U = "LAN"))
(Here, multiplication is logical, meaning AND).
To filter the scores by "either within 14 days or among the last 10", the condition would be:
=filter(K2:K, (B2:B >= today()-14) + (rank(B2:B, B2:B, false) <= 10))
Here + is logical OR, and the rank is in descending order, picking the 10 largest entries from the date column.
It remains to combine these. In the interest of maintainability, it may be best to do things separately (perhaps on another sheet): apply the first filter, and then use the second on its output. But it's possible to do everything in one formula, it just looks scary: the first filter is applied to each column appearing in the second filter.
=filter(filter(K2:K, (G2:G = "HenkkyG") * (U2:U = "LAN")), (filter(B2:B, (G2:G = "HenkkyG") * (U2:U = "LAN")) >= today()-14) + (rank(filter(B2:B, (G2:G = "HenkkyG") * (U2:U = "LAN")), filter(B2:B, (G2:G = "HenkkyG") * (U2:U = "LAN")), false) <= 10))
This is not the kind of formulas that I would want to deal with in a spreadsheet inherited from someone else. |
H: Prevent importXML from spilling text across multiple columns
When importing chat transcript by importXML, e.g.,
=IMPORTXML("http://chat.stackexchange.com/transcript/7/2015/8/13", "//div[@class='content']")
I find that some messages split across several columns:
+-------------------+---------------+----------------+
| "The tag-wiki ... | google-search | tag instead. |
+-------------------+---------------+----------------+
I understand this happens because "google-search" is within its own HTML element:
... use the <a href="//webapps.stackexchange.com/questions/tagged/google-search"><span class="ob-post-tag" style="background-color: #E2EDFA; color: #5D7A9C; border-color: #5D7A9C; border-style: solid;">google-search</span></a> tag instead.
But I don't want to have multiple columns like that. I want all chat message in the same cell:
The tag-wiki contains the sentence: If you are talking about search, use the google-search tag instead.
Is there a way to either prevent importXML from using breaking text into columns, or to join them back? join("", importxml(...)) throws an error because the range is two-dimensional.
AI: Short answer
=TRANSPOSE(
QUERY(
TRANSPOSE(
IMPORTXML(
"http://chat.stackexchange.com/transcript/7/2015/8/13",
"//div[@class='content']"
)
),
,
1000
)
)
Explanation
IMPORTXML is returning an array having one column by each inner span tag. There is one span tag by each smart link included in the chat message.
"It's known" that QUERY joins the headers rows. As in this case the OP wants to join rows, the formula includes TRANSPOSE two times, the first to be able to use the QUERY behavior to join columns and the second to return the array to the original shape.
Reference
Answer by JPV to Google sheet arrayformula join() and split() functions |
H: Present importXML output in reverse order
How to reverse the order of the output of imporxml? For example, =importxml("http://example.com","//p") outputs
+---+---------------------+
| 1 | This domain is ... |
| 2 | More information... |
+---+---------------------+
and I want
+---+---------------------+
| 1 | More information... |
| 2 | This domain is ... |
+---+---------------------+
I know various ways to reverse a range already present in a sheet, for example
=query({A:A, arrayformula(row(A:A))}, "select Col1 where Col1 <> '' order by Col2 desc")
outputs nonempty cells in column A in reverse order. However, I'd like to reverse the order without the intermediate step of placing the output in the sheet. Trying arrayformula(row(importxml(...))) throws an error: "Argument must be a range".
AI: Use COUNTA and ARRAY_CONSTRAIN to set the size of the sequential number array to be used as the sort column. Example:
=ARRAYFORMULA(ARRAY_CONSTRAIN(ROW(A:A),COUNTA(IMPORTXML(range,xpath)),1))
The final formula should look like the following:
=ARRAYFORMULA(
ARRAY_CONSTRAIN(
SORT(
{
IMPORTXML(url,xpath),
ARRAY_CONSTRAIN(ROW(A:A),COUNTA(IMPORTXML(url,xpath)),1))
},
2,
FALSE
),
1E100,
1
)
) |
H: Google sheets calculate the amount to be invested per month to generate an amount desired using compound interest
Let's say I want to generate $100,000 over 5 years at 9% interest compounding yearly.
Is there a function or formula that will let me calculate the amount to be invested per month to reach that goal in that period of time?
I looked into the financial functions here, this one looked similar but doesnt do what I want.
AI: The command PMT can be used for this. Specifically,
=PMT(0.09, 5, 0, -100000)
returns $16,709.25. I checked that the amount is correct:
$16,709.25 after 1 year (investment only)
$34,922.32 after 2 years (investment + 9% interest on 16,709.25)
$54,774.58 after 3 years (investment + 9% interest on 34,922.32)
$76,413.54 after 4 years
$100,000.00 after 5 years |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.