text
stringlengths 83
79.5k
|
---|
H: Lock two Google Sheet cells to each other
Is there any way to lock two Google Sheet cells to each other?
What I need:
I have data in cells A1 , B1 ; A2 , B2 , ...
A1-B2 / A2-B2 must be adjacent.
I need to sometimes copy A1-B1 to different place in the same sheet, but users are copying only A1 without B1.
So if someone copies A1 (without B1) to, for example, D5, I need to automatically copy B1 to E5.
Is that possible?
AI: Such locking is not possible. Users can always choose to copy one cell and not the other.
Alternative suggestion: combine data A1-B1 in one cell A1, separating it by a linebreak or some other character that will not appear in the data itself. Then it will be copied as a whole. When you need to use it, you can apply split(..., char(10)) to split the contents by the linebreak, and then work with the individual pieces. |
H: Hide a row of cell when a specific cell is filled
I am trying to hide a row of cell when a specific cell is filled in on Google Sheets
For example:
On row 2 cell E2 is filled in with "1", I want to be able to hide the entire second row.
Is there a possible way of doing this?
AI: You need a script for this. This script runs on every edit (onEdit), checks whether the edit is in the 5th column (E), and if the new value is 1, then it hides the row of that cell.
function onEdit(e) {
if (e.range.getColumn() == 5 && e.value == 1) {
e.range.getSheet().hideRows(e.range.getRow());
}
} |
H: What is a "Locked Topic" on Google Product Forums?
Visiting the Google Chrome Help Forum, I see some topics that are marked as Locked. There is a small gray padlock icon to the right of the title. Here’s an example: https://productforums.google.com/forum/#!topic/chrome/mu6_a2z9iJ0. I assume this means no new replies are allowed, but I cannot verify this assumption, nor can I seem to find any information about what a Locked Topic actually is.
I tried searching the Google Product Forums about this, but unfortunately haven’t found any search results pertaining to the forum itself. (Like a "meta" forum for questions about the forum).
Can anyone point me to some official Google documentation on the inner-workings of Google Product Forums, specifically on Locked Topics?
AI: A "locked" topic simply means that a topic can no longer be replied to/answered.
"Locking" a topic is a Moderator action.
From Groups Help: Permissions, "Lock Topics" is a permission that Moderators have:
Lock Topics
A person with this permission can lock or unlock a topic.
This suggests that it's a policy decision by the Moderators of the Product Forums. You'd need to check with them for what their criteria are. From what I can see, they seem to lock conversations that are old and don't have recent replies, resolved questions, etc. |
H: Created new Gmail account while logged in with non-Gmail email
I created a new Gmail account for my daughter while logged on as myself (account was created using non-Gmail address). While I was doing it, it asked if I want to be able to manage this email using existing account. I clicked yes.
And now I have an account, where main email is my daughter's and I can't change it because it's Gmail and as such it is non-removable.
I can pass my account to her completely, but I can't create new account using my email, because it already exists. I can remove it, but I still won't be able to, because it seems that removed account is not really removed.
I'm pretty sure nothing said I'm setting up new email for my account - I was creating new Gmail address.
Is there a way out of this situation?
AI: The primary email address of your Google account was "converted" to an alternative email address when you added a Gmail address for your daughter.
From Remove addresses from your account
Here's how to remove an alternate email address from your Google
Account:
Sign in to your account at myaccount.google.com.
Select Email in the Personal info box.
Select Edit next to Other emails.
Under "Change your associated email addresses," select the "X" to Remove.
See what usernames
you can remove from your Google Account. |
H: How to prevent G+ to show animal posts on my timeline
I know that G+ learns what you like/see, and even though I have never, ever, clicked (given focus) on an animal post (90% cats, 9% dogs, 1% other animals) shown on my timeline, most of the time I wait for the animation to load, so the harm is equally done.
I have never joined an animals group or anything similar, but they show on my timeline more often every week. Same with super cars, and lately with road bikes.
How can I stop G+ suggesting (it does well!!) and inserting on my timeline subjects I have not explicitly joined or subscribed?
AI: This is only a partial solution but it could be the best we can do with G+ today:
Partition the G+ accounts you follow into circles read1 (first priority), read2 (second priority), read3, ... as many as you want. Put all the "WOA Animal" community into the final circle, we'll call it readBewareOfAnimals.
Expand Circle Streams in the left column, click on read1, and read that circle first. This circle should contain the accounts you most want to read, not accounts that are too verbose for your tastes.
When you have additional time, read the read2 circle and maybe move on to the read3 circle.
Once in a while, zip through readBewareOfAnimals. That way you won't totally miss what those friends post but you won't have to face fuzzy faces the rest of the time. It's considerably less spammy when you know what you're diving into.
You can put the same accounts into various circles organized for you to post to, e.g. Friends, Family, Acquaintances, Just Following, ... |
H: How to change Yahoo! account Secret Answer?
I started a Yahoo! mail account a while ago. This was meant to be just a throwaway/spam email account. However, because it was easy to pass around, I ended up depending on it quite heavily.
Since I didn't pay attention while filling the account creation form I am wondering if it is possible/how to change your Secret Question's answer.
AI: I no longer see a Secret Question for you to answer in order to get a password changed. They now verify it is you by using a secondary email address to send you a code or they will text you a code to your phone number to verify it is you. Those are both in the upper right of the screen under the gear and then account info. From there you go to account security. From here you can add a phone number to which you can receive text messages. If you chose you can also add a secondary email so you can get verified this way as well. |
H: How to open a Google Sheets file and go immediately to the end of the file
I have a Google Spreadsheet with 100 lines.
Every time I open that file, I want to insert a row on the end of my table.
How can I jump to the last line of the table when I open the doc?
Because right now I have to scroll down in order to be able to insert a new line.
AI: You can create a trigger that runs every time your spreadsheet is opened.
Go to Extensions → Apps Script and paste the following:
function onOpen(e) {
var spreadsheet = e.source;
var sheet = spreadsheet.getActiveSheet();
var lastRow = spreadsheet.getLastRow();
if (sheet.getMaxRows() == lastRow) {
sheet.appendRow([""]);
}
lastRow = lastRow + 1;
var range = sheet.getRange("A" + lastRow + ":A" + lastRow);
sheet.setActiveRange(range);
}
Click the Save button, then close the script editor, and the spreadsheet.
Now, open your spreadsheet again. Give it a couple of seconds, and you should see that a new row is inserted at the end of your sheet, and that that row is selected.
I have created this spreadsheet to demonstrate - feel free to copy it (click File → Copy). You will need to run your own copy in order to see the script run successfully.
The script explained:
The onOpen function name has a special meaning. See documentation.
It takes a single argument, an Event object. Its source property is a reference to the spreadsheet being opened. With the spreadsheet, we can do getLastRow() to find the index of the last row that has content. getMaxRows() gives us the max number of rows in the sheet, even empty ones. With that knowledge, we can see if the last row has content - if so, we append a new, empty row. Finally, we can create a range and call setActiveRange on it, to move to the last row.
If you just want to move to the last line, not inserting anything, the script can be simplified as this:
function onOpen(e) {
var spreadsheet = e.source;
var sheet = spreadsheet.getActiveSheet();
var lastRow = spreadsheet.getLastRow();
var range = sheet.getRange("A" + lastRow + ":A" + lastRow);
sheet.setActiveRange(range);
} |
H: How do I copy the address from Google Maps?
How do I select and copy the address from Google Maps? I need to copy the info to a restaurant into a Meetup. It won't select the text!
AI: I see what you mean. The address in the information card seems to be non-selectable with the mouse and dragging over the text.
However, if you triple-click the address, the text is highlighted and can be copied with a Ctrl+C (or right-click and choosing "Copy").
Since I originally posted this, it seems that Google have fixed a bug on their end. I can now select the address by dragging with the mouse. |
H: No "Going" button in Facebook event
I want to join this Facebook event, but there is no "Going" button:
How to join the event?
AI: The "Going" button is hidden behind the "Interested" button:
Click on "Interested",
Click again on "Interested",
A menu appear, showing additional options "Going" and "Not Going",
Click on the "Going" option that appeared. |
H: Facebook targeted ad to target younger than 18
We have a free course which educates children between 14 and 16 how to learn and behave with disabled children and how to best help them.
We plan to advertise it via Facebook targeted ads. But... We cannot create an ad to target younger than 18. But in reality all children from our aim group have Facebook accounts.
How shall we then advertise this course for our aim audience?
AI: When choosing your ad set, the default range is 18-65. You should be able to change it. |
H: Conditional format for column headers where all cells are numbers
I'm trying to color the header if all of the cells in that column are numbers. Blank or non-numbers should break this.
I have:
custom formula: =ISNUMBER(A3:A)
But it styles the cells instead. Not sure how to specify the header cell within this formula.
AI: Apply conditional formatting with custom formula
=arrayformula(sum(N(not(isnumber(A3:A)))))=0
This can be applied even to a range of headers such as A1:E1; the formula, entered as above, will be interpreted in a relative way for other columns.
Explanation
not(isnumber(...)) is true if the entry is not a number
N converts logical true/false to integers 1 or 0
sum adds these.
arrayformula makes sure the entire range is handled
the sum is equal to 0 if all entries are numbers.
Note
Dates and times are considered numbers, because internally, they are. For example, the date 05/26/2016 is the number 42516 formatted as a date. |
H: Autoincrement a date in a formula when dragging horizontally
I have a date in column A, and a formula in column B that references the date. I'm trying to drag the formula over to 6 more cells horizontally, representing the 7 days of the week, Column A being Sunday's date, and Column B being Monday's date. I could technically just have 6 distinct formulas where it's Column A's date value+1, +2...+6. But that's a pain in the butt. Is there a way to autoincrement the value being added?
Here's exactly what I have:
AI: You can achieve this with one formula entered in cell A2:
=arrayformula(date(2016,5,21) + 7*(row(A2:G)-2) + column(A2:G)-1)
Here, date(2016,5,21) is the date you want to begin your calendar with. The term 7*(row(A2:G)-2) increments the date by 7 for each row after the 2nd one (since you begin with A2). The term column(A2:G)-1 increments by 1 for each column after the 1st one.
You'll also need to choose the desired date format for the range A2:G.
This list of dates will automatically expand if you add more rows to the sheet. |
H: Is there a way to work on a Google Drive doc offline?
I'm going to be in an area with shotty internet connection. I would like to be working on a Google Drive doc but know it usually doesn't let you edit if it's not connected to the internet. Is there a way around this? I will be the only person working on it and it's not shared. If relevant I'm using Windows on a laptop with Firefox.
AI: I am afraid you need to switch (just for editing your docs) to Google Chrome.
As per the documentation found here :
"Offline access is only available in the Google Chrome browser."
Once on Chrome, under the corresponding settings, you can enable offline editing per file:
OR for all files: |
H: How do I use create orders/quotes in Cognito Forms without connecting to Stripe/PayPal?
We would like to use the payments feature but we don't want to actually receive online payments. We just want to give quotes to our clients.
As far as we understand we can do that by creating a Stripe account, then activating the payments feature at Cognito Forms, and then selecting "Require Payment" to "Never". The problem is that we can't create a Stripe account because Stripe does not support our country yet.
Is there any other way to activate the Payments feature?
AI: You can use the payment features of Cognito Forms without connecting to Stripe or PayPal. This is a great way to generate orders/quotes!
When you add your first payment field, the dialog asking to connect a payment account automatically appears (for connecting to Stripe or PayPal). Just cancel out of the dialog, and you can use all of the payment features without connecting. If in the future you need to add payment, you can add a payment account under payment settings. |
H: Gmail chat not working after power outage
There was a power outage here earlier today that lasted long enough to shut my computer off. (I never thought I'd be asking a question about a power outage on this site, but here we are.) When I rebooted, I didn't see any error messages or major weird behavior from my computer. I'm running Windows 10 on a desktop with up-to-date Firefox (v46.0.1) as my browser.
Really the only thing that wasn't working correctly was Google, and then only some services. The actual email functions of Gmail were working fine, and I could receive messages in the Hangouts chat widget built into the Gmail sidebar, but every time I try to send a message in Gmail chat, I get the error Message not delivered.
Google Sheets was behaving oddly too, for a while. I couldn't load my main list of spreadsheets at sheets.google.com, but if I went to a specific sheet with a direct link I could read it, but it also said Trying to connect at the top of the page forever and wouldn't let me make changes. That eventually went away, I don't know why but I think hard refreshing might have helped somehow.
I've tried
logging out of Hangouts and logging back in, in the Gmail sidebar
using the standalone Hangouts text chat at hangouts.google.com, and logging out/in there
logging out of my Google account entirely and logging back in
clearing my Firefox cookies and cache
hard-refreshing the Gmail and Hangouts Firefox tabs
None of it has helped. All other Internet stuff works fine, as far as I can tell. Hangout chatting works fine on my cellphone for both sending and receiving, and the phone uses WiFi coming out of the same router the affected computer is Ethernet-cable-ed into. As a temporary fix I can even get outgoing chat to work from inside Gmail if I click the "Revert to old chat" link in the options menu. But if I then click "Try the new Hangouts" the error comes right back.
I'm out of ideas. What else can I do to fix chat?
AI: I would try uninstalling Firefox. After this download CCleaner and clean the registry. Of course, save your registry with CCleaner before making changes in case you need to revert. CCleaner is a free product and very useful when trying to clean up your system. Download it here.
https://www.piriform.com/ccleaner/download
After this reinstall Firefox and give it a shot.
Once you reinstall remember reinstall the hangouts plugin. If you don't have it you'll also need to install the Adobe Flash (latest version) player. |
H: Include label into Google mail address
I have seen that it is possible to label e-mails by using tags in the e-mail address. For example if my address is myaddress@gmail.com then it is possible to send e-mail like myaddress.offer@gmail.com where offer is a tag. How to enable this feature in Gmail?
AI: Gmail supports address tags using the + separator. This is always enabled, however, there is no automatic labelling – you have to manually create filter rules to match each "To:" address. |
H: How to contact seller when there is no Contact option?
I've bought the product which stopped working after few months of using it and I'd like to contact the seller if they can exchange or repair it, but I couldn't find the option to do that.
I've tried so far:
How do you reply to a seller on Amazon?, but there is no 'Contact seller' button,
read Contact Marketplace Sellers, but I couldn't find Further Information section with Contact,
You can contact a Marketplace Seller both before and after placing an order.
Which is not true, because I don't see any option to do that. Either before or after the order.
can't return, because This item is no longer eligible for return.
Any ideas?
AI: In About Our Returns Policies you can read:
If a product becomes defective after 30 days you won't be able to create a returns label using our Returns Support Centre - you'll need to Contact Us. You may wish to visit the manufacturer's website or contact them directly as they may be able to offer troubleshooting and support with the issue you have with the product. Please see Manufacturer Contact Details and After Sales Service.
So basically you've to go to Contact Us page, select the order, then select as Defective and choose the form of contact, either by E-mail, Phone or Chat.
I've selected Chat and the replacement (free home collection) was arranged within few minutes. |
H: Can a user DM another user if they were once blocked but now aren't?
user1 and user2 have a direct message conversation.
user2 blocks user1.
user1 blocks user2 and deletes the DM conversation.
user1 unblocks user2
user2 unblocks user1
user2 follows user1
user1 does not follow user2
user2 has a private account
user1 has a public account
user1 twitter security option: receive message from anyone is not checked
Can user2 direct message user1?
AI: Yes, because user1 has a public account and has a setting to receive message from anyone. So user2 can send direct message to user1 even if user1 doesn't follow user2.
But user2 will not be able to send message if user1 has a setting to not receive message from anyone or only whom I follow. |
H: How to Determine the Xpath Query to a Datapoint in a Table for Use with IMPORTXML?
I'm looking to retrieve the most recent financial figure for a single data point from a table using IMPORTXML.
The target page displays three sets of financial figures for a company on quarterly and annual bases. In this case, I only want the "Total Debt" figure listed from the balance sheet for whatever is the most recent fiscal period available.
I've used the following IMPORTXML formula:
=IMPORTXML("https://www.google.com/finance?q=GOOG&fstype=ii","//td[contains(.,'Total Debt')]")
This results in only the data label displayed vertically in two adjacent cells.
Total Debt
Total Debt
I've also used this IMPORTXML formula with the Xpath query determined using Chrome:
=IMPORTXML("https://www.google.com/finance?q=GOOG&fstype=ii","//*[@id='fs-table']/tbody/tr[27]/td[2]")
This results in four values (data from two financial statements for two periods each) displayed vertically, as below, in adjacent cells with the third value down being correct. Per this answer to another discussion, I've tried removing the "tbody" element node resulting in an "#N/A" error: "Imported content is empty."
4,207.00
15,826.00
5,208.00
5,220.00
For now, I'm trying to avoid using IMPORTHTML and INDEX for parsing a whole table since I need only a single value from the table.
How do I determine the Xpath query for this page to retrieve (1) the "Total Debt" figure for (2) always the most recent reporting period?
EDIT: Because there are two elements with same name, "Total Debt," I had also tried using the below formula with and without predicates (appending 1, 2, [last], etc. in square brackets) and got returned an error with empty content.
=IMPORTXML("https://www.google.com/finance?q=GOOG&fstype=ii","//*[local-name() = 'Total Debt'][1]")
AI: Short answer
AFAIK, regarding XPath queries to be used with IMPORTXML there isn't straightforward method as XPath 1.0 support looks that was not fully implemented and the web pages developers could follow the practices to set the structure of their webpages.
Explanation
While the use of tools like Chrome Developer Tools or browser extensions/add-ons could be helpful sometimes these tools doesn't return a XPath query that could be used by IMPORTXML due to differences on how XPath support was implemented by the developers of each tool, by the other hand, web pages could comply or not with the XML rules, so to find the XPath query to be used with IMPORTXML could be necessary to analyze the structure of the source web page and to do several tries.
XPath queries for the use case
The below XPath queries returns 5,208.00
1.
//div[@id="balinterimdiv"]//tr[contains(.,'Total Debt')]/td[2]
2.
(//tr[contains(.,'Total Debt')]/td[2])[1]
Explanation
The referred page includes two views for the Balance Sheet: Quarterly Data and Annual Data. Both of them looks to have the same structure as both includes a table cell (td tag) with the text Total Debt. Fortunately, each view are inside a div tag and each of them have their own id, so in order to get only one, the first step in the XPath query could be to select the right view, then the second step could be to select the right table row (tr tag) and the third step to select the right table cell (td tag).
Another approach is to use the construct (xpath_query)[position() = 1] (see the reference).
References
Answer by Dimitre Novatchev to What is the XPath expression to find only the first occurrence? referred by Dale in a comment to another answer to the question in this thread. |
H: Can I host custom forms using Google Apps Script?
Is it possible to have custom forms created using Google Apps Script to have their own URL just like Google Forms do and be publicly available?
Can I host these custom forms somewhere without using Google Sites? For example, Google Drive?
Please can you point me in right direction.
AI: Yes, you can, by creating a Google Apps Scripts webapp.
It is basically a Google Apps Script which has a doGet() and/or doPost() function.
Your webapp will have a URL similar to that of a Google Form.
See the documentation for Google Apps Scripts Webapps. |
H: How to find URL of the current sheet
In Google Sheets, how do I create a hyperlink to this sheet?
I have a sheet which I'm about to download as PDF for archive. It would be useful to include a link in the sheet, pointing to itself, so that later I could click the PDF link and open the sheet again.
Of course I could copy the URL from the address bar, and insert the hyperlink:
=hyperlink("https://docs.google.com/spreadsheets/d/asdf/edit#gid=0","Link")
but I'm looking for a more general method.
AI: Open menu Tools → Script Editor and paste this code:
function getSheetUrl() {
var SS = SpreadsheetApp.getActiveSpreadsheet();
var ss = SS.getActiveSheet();
var url = '';
url += SS.getUrl();
url += '#gid=';
url += ss.getSheetId();
return url;
}
Close The Script Editor.
And use this formula:
=hyperlink(getSheetUrl(),"Link") |
H: Should you keep your Instagram API access token secret?
I've been trying to use Instagram's API to extract tagged photos to show on a website, but have had trouble generating an access token (not part of this question).
I see that there are many JavaScript scripts for showing Instagram feeds and usually they require you to add your access token in script.
So I just found a random website using one of these scripts and borrowed their access token (just for testing).
So my questions are, what is the point of going to the trouble of generating an access token if it just gets made public anyway? Could someone do something malicious with my access token? Will it affect rate limits? Basically, should they be kept private?
AI: Yes, API tokens should be kept private. Think of them as a replacement for your username and password. It's another way of authenticating who you are and what type of access you should have.
As for what can be done with any particular API token, this varies from service to service. Some services allow you to create API tokens with limited access, some only have one level of access.
Some sites provide API tokens with limited or public access with the idea being you can use these to experiment with and learn your way around their API. These usually only have 'read' but no 'write' access. |
H: How to add columns if a neighbor does not exist in google sheets
I have a sheet that looks like this:
estimate | actual | name
10 | 1 | Bob
20 | 9 | Sue
30 | | Bob
40 | 3 | Sue
How can I get a sum of where the name is "Bob", and the sum of the actual column if it exists, but if not use the estimate column instead (i.e. 1 + (blank -> 30) => 31)
I keep running into issues with mismatched range sizes - is there any way to do this in one formula without adding lots of "dummy" columns (i.e. if actual , actual , else estimate) and so on? or without needing to create a "Bob" column and always check against that?
AI: This can be done with two sumifs formulas:
=sumifs(B2:B, C2:C, "Bob") + sumifs(A2:A, C2:C, "Bob", B2:B, "")
The first adds "actual" quantities (column B) where C is "Bob". The second adds "estimates" (column A) where C is "Bob" and B is blank. |
H: What is a Twitter Timeline and how do you use it?
What is a Twitter timeline, and how does it work? How do you access it? Is this a timeline in "Moments"?
AI: It's simply your Twitter home page.
From Twitter support:
When you log in to Twitter, you'll land on your Home timeline.
Your Home timeline displays a stream of Tweets from accounts you have chosen to follow on Twitter. You may see suggested content powered by a variety of signals. You can reply, Retweet, or like a Tweet from within the timeline.
Tweets you are likely to care about most will show up first in your timeline. We choose them based on accounts you interact with most, Tweets you engage with, and much more. You can find instructions for how to turn off this behavior here.
You may see a summary of the most interesting Tweets you received since your last visit, labeled as While you were away.
You may also see content such as promoted Tweets or Retweets in your timeline.
Additionally, when we identify a Tweet, an account to follow, or other content that's popular or relevant, we may add it to your timeline. This means you will sometimes see Tweets from accounts you don't follow. We select each Tweet using a variety of signals, including how popular it is and how people in your network are interacting with it. Our goal is to make your Home timeline even more relevant and interesting.
Clicking anywhere on a Tweet in your timeline expands the Tweet, so you can see photos, videos, and other information related to that Tweet.
Where you'll see other timelines:
Timelines can also consist of collected Tweets from users in lists that you've curated or as search results.
When you click on a list, you will see an aggregated stream of Tweets (a timeline) posted by the users included in that list.
Similarly, when you perform a search, you'll see a timeline of Tweets that all match your search terms. |
H: How do I add a field in Google Forms to show the sum of multiple fields (that are numbers)
Say for instance I want the user to input into 4 fields the meters they will dig up in different areas. On the form itself I would like to have a number at the bottom displaying the sum of 3 of said fields.
Is this possible? If it is, how do I go about getting it done?
AI: Google Forms doesn't include calculated fields. One alternative is to create a web app by using Google Apps Scripts. |
H: Google Calendar reminder for every other day except Saturday and Sunday
How do I create a reminder for every other day except Saturday and Sunday?
M T W TTH F Sa Su
1st Week * * *
2nd Week * *
3rd Week * * *
AI: This can be done as two repeated events, rather than one. Create two identically named events, one of which happens on MWF every other week, and the other on TTH of every other week, starting a week later. |
H: How to un-do restricting website's access to Facebook?
I went to sign up for one of many, many web services (in this case "Honey") which supports logging in with Facebook. When I was prompted what Facebook information I'd like to allow access to, I unchecked the option to get my Email. Upon proceeding, the website stopped me and said email is required. But now, whenever I attempt to login with Facebook again, I'm no longer prompted to allow or dis-allow access in order to give it access to my email.
How can I un-do this restriction so that I can go back and give it access to my email?
AI: In Facebook, on top top-right, click on the icon representing a lock to open the Security menu. Go to "See More Settings".
On the next page, go to "Apps" in the list on the left. This will show a list of all apps which you have allowed to access your Facebook account. Find this one ("Honey") and click on it.
This will show what pieces of information you have granted. On the bottom of this screen, choose "Remove App".
And confirm.
Then, go and sign up again. And don't uncheck that email option! |
H: Sending emails onSubmit using Google Apps Script Web Forms
Is it possible to send emails onSubmit() with Google Apps Script Custom Web Forms just like we can do using mailApp with Google Forms?
I am currently transferring google forms code into html forms but I can't seem to find how I would be able to send email notifications like I have done for Google Forms.
Any pointers/links will be really helpful.
AI: You need to use the google.script.run.myServerFunctionName() client side API. You will need to use that anyway, in order to send the form data, unless you are using a HTTPS GET or POST request to send the data somewhere.
Apps Script documentation - google.script.run |
H: How did Facebook get the "people you may know" without my email address?
I created a Facebook account, and the email address was freshly created with that account.
I have never sent any email from that email address and the only emails I have received has been welcoming ones from Google and Facebook .
I go to the Facebook homepage, and it says "People you may know".
It lists two people one of whom I know. Where is it pulling them from? / What are the sources that Facebook pulls these things from?
AI: Facebook may have suggested:
People you searched for earlier (even not logged in, but from the
same machine!)
People who have searched for you
People from same school, workplace or village
People who have your associated phone numbers in their address book
Friends of people you have blocked
For further information, please see the links below:
Facebook has published its "personalized ads" policy for those not
having an fb account: link1
Facebook published announcement in a 2014 company blog post that
they are using backend data gathering to build user profiles even if
user has no fb account, but uses any of their services
link2,
link3 |
H: How to turn off Insert/Overwrite in Google Spreadsheets
When editing text in Google Spreadsheets, in the formula bar, or editing the name of the sheet, overwrite is toggled, and pressing the insert key (numberpad or 'regular' insert key, numlock active or not) has no effect on this behavior.
I believe I caused this while entering unicode or extended ASCII characters into other webpages. Still unsure of real cause. Google Chrome browser.
AI: When I double click on the cell itself, and then hit the insert button, the overwrite will toggle off for not just that cell but also for the entire application. |
H: Why does archive.org say that it got HTTP 302 for this URL?
I have an URL https://www.uni-muenster.de/Physik.FSPHYS/index.html which uses an HTTP 301 response to redirect to the URL https://www.uni-muenster.de/Physik.FSPHYS/. However, when I look at the saved URL in the Wayback Machine (archive.org), I get this:
So archive.org claims that it got HTTP 302 as a response. As far as I can tell, this is not true (should be 301). Is this a bug in the Wayback Machine or am I missing something?
AI: It's a bug in the Wayback Machine, inserted in 2010.
It's now fixed in the current Wayback Machine, and also our next-gen Wayback. |
H: Why does archive.org say that this URL is not available?
If I try to save the URL https://www.uni-ms.de/de/ using the Wayback Machine (archive.org), I get the following response:
However, the site is perfectly fine, and I haven’t been able to find anything strange in the HTTPS certificates or HTTP response headers, either: https://www.uni-ms.de/de/. Saving the HTTP version http://www.uni-ms.de/de/ works without issues, too. What’s the problem here?
AI: There's something about the way this server uses SNI that is incompatible with Java's libraries:
https://www.ssllabs.com/ssltest/analyze.html?d=www.uni-ms.de
So no, our crawler can't talk to it over https. I haven't seen this particular problem before.
This one works: http://web.archive.org/web/*/https://www.uni-muenster.de/de/ you can see the save I just made.
Surfing the tubes of the Internet, this appears to be a change that the server could make to not confuse Java. See this answer to SSL handshake alert: unrecognized_name error since upgrade to Java 1.7.0.
[Earlier I claimed I had saved it, I wasn't paying attention and I was actually looking at an earlier snapshot.] |
H: Google Finance Chart Zoom not working
If I pick a stock, say Ferrari, and view it's stock price chart at Google Finance, and click on different zoom levels, e.g. 5y or 10y, the chart does not update.
This occurs in Chrome and Internet Explorer on 2 different PCs.
I think I am misunderstanding the way Zoom works?
If clicking on the different zoom levels is supposed to dynamically update the chart, what can I do to ensure this works.
I have no similar issues on different websites, and JavaScript is enabled.
AI: Any time range exceeding the range for which the data are available has the same effect as "All". In the case of Ferrari, this includes the 1y and 5y ranges, since the company has become independent in January 2016.
Pick a stock symbol with a longer price record, such as MSFT, to see that both 1y and 5y zoom levels indeed work. |
H: Any way to send Gmail Out of Office/Auto-reply at the same times every week?
Because my clients bother me out of hours I would like to have my Out of Office respond out of hours without having to set it manually every day.
To comlicate matters further I want to send one message on between Friday 5pm and Monday 9am and a different message out of hours on all other weekdays.
How do I do that?
I am no coder, so do I just duplicate and adjust the IF statement (apologies if this is the wrong terminology) and adjust to suit?
Also, would I be correct in thinking that this sends a plain text response? I would like to send an HTML response so that it will display corporate logos etc. like a standard email reply.
AI: Here is my answer to my own question.
function autoReply() {
var interval = 5; // if the script runs every 5 minutes; change otherwise
var wkend = [6,0]; // 1=Mo, 2=Tu, 3=We, 4=Th, 5=Fr, 6=Sa, 0=Su
var wkendMessage = "Hi, Thank you for contacting us. The office is now closed. All emails will be attended to when the office re-opens at 9:00am on Monday morning.";
var wkdayMessage = "Hi, Thank you for contacting us. The office is now closed. All emails will be attended to when the office re-opens in the morning.";
var date = new Date();
var day = date.getDay();
var hour = date.getHours();
if (wkend.indexOf(day) > -1 || (day == 5 && hour >= 17)) {
var timeFrom = Math.floor(date.valueOf()/1000) - 60 * interval;
var threads = GmailApp.search('is:inbox after:' + timeFrom);
for (var i = 0; i < threads.length; i++) {
threads[i].reply(wkendMessage);
}
}
else if (hour < 9 || hour >= 17) {
var timeFrom = Math.floor(date.valueOf()/1000) - 60 * interval;
var threads = GmailApp.search('is:inbox after:' + timeFrom);
for (var i = 0; i < threads.length; i++) {
threads[i].reply(wkdayMessage);
}
}
}
I still need help to format the output so that there are images in the footer though :) |
H: Increase fraction size in Google Docs equation
Fractions in Google Docs equations are too small to read:
How can I write normal-sized fraction?
AI: Ugly equation:
Left side: one usage of equation builder. Increase font size.
Right side: use another instance of equation builder.
In this example, 30px on the left, 18px on the right. The formula writer tried to keep the box (container for formula) the same height as the rest of the line height; shrink to fit. |
H: Google Apps - Access directory contacts on mobile devices
So after setting up Google Apps for a small business, I've been amazed at how it fills the role as a simpler Active Directory.
However, how can I access these contacts on a mobile phone, e.g.,an iPhone? As far as I can tell, it doesn't sync to my phone.
AI: It seems the contacts doesn't sync, but you should be able search them from your iPhone. This means you have to be on-line to find them. From support.google.com:
How to search your Google Apps Directory and Global Address List on iOS
On your iPhone, launch the Contacts app.
Go to the Groups selection screen.
Select your_account Global Address List, where your_account is what you've named your account on the device.
Search for a contact.
All of the matching contacts from your directory should show up, such
as users in your domain. You can search for users in your organization
using this method even if they're not listed as contacts on your
device under My Contacts.
This presumes you have set up your Google Apps for Work/.edu/.gov account as an Exchange Active Sync account on your iPhone. See Google's documentation for that.
I just tested this for myself. I'm able to search the global contacts, and for any result I can choose to add it to my local address book, or update an existing contact. |
H: Track highest number in a cell over a series of recalculations
How do I keep track of the highest number that was in a cell in Google Sheets?
I'm running random numbers through a cell and I would like to track the highest number reached. Specifically, I am trying to count the number of matches between two random columns. I'd like to keep track of the highest number of matches between sheet refreshes. I have a button that I click to force recalculation on the page.
AI: To keep track of running maximum of the content of some cell, one needs a script that runs every time the cell changes value. Such a script could be triggered by the same button you are using to force recalculation, although a delay (Utilities.sleep(1000), time in milliseconds) may be necessary to make sure the recalculation runs before this script. Or, if recalculation was caused by an edit to the sheet, the function could be simply named onEdit to run on every edit.
In this example, B1 is used to record the maximum of values that were placed in A1.
function recordMax() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("A1:B1");
var values = range.getValues()[0];
range.setValues([[values[0], Math.max(values[0], values[1])]]);
} |
H: Data Validation: how to ensure all columns have unique data within the column
I finally found this answer which tells how to use data validation to make sure all the values in one column are unique.
But it doesn't tell if there is a way to write a single validation rule that can make sure that all the values in multiple columns are unique per column. So far the only way I see is to replicate the validation rule for each (of 50 or so) columns individually.
Is there a way to do that with a single rule? It would hinge on where to put the $, I suppose, and the rules for doing that don't seem to be well documented, especially how they get interpreted inside validation rules.
AI: Well, after a bit of fiddling, I found a solution that currently works:
Specify the cell range as desired: for the whole columns, starting with column A and ending with column BB, so it is
A1:BB
Then the custom formula should be:
=countif(A$1:BB,"="&A1)=1
It seems like the Data Validation operation the places this "validation formula" (which must be True to avoid a warning) in every cell, as if a regular formula were copy/pasted to the cell. Which might allow a bit of intuition as to when and how to place the $ in the cell references, if true. It seems as if the formula should be written as if for the top left cell of the range specified. |
H: A repeat reminder not showing after 1 year in Google Calendar
I have added a new repeat reminder in Google Calendar. If you look forward in the calendar that repeat stops after 1 year. Why? The "Ends" is set to "Never".
Starting from July 2017 the reminder is missing from the calendar.
AI: Based on your question it sounds like you created a recurring daily event, not a Calendar reminder. Reminders appear on your calendar each day until you mark them as done. You can create them using these directions.
While I didn't find it documented anywhere, in my experience daily recurring events will only appear on your calendar for the next year, but this will update every day. In other words if this daily event shows up for June 10th, 2017 but not June 11th, 2017 right now, wait 24 hours and it will then appear for June 11th, 2017. To put it yet another way, you should see daily recurring events for approximately the next 365 days, regardless of the current date. |
H: Does the admin of a public Facebook page know who hides another person's comment?
When a person does not like another person's comment on a public Facebook page, I suppose the best thing he/she can do is to hide that comment. But when he/she presses the hide link, will this information be notified to the admin? Or can the admin have any way to check who hides the comment?
AI: No, it will not be notified to the admin. And there is no official way to check who hides the comment. When he/she hides a comment, it is just hidden from his/her view, others can still see it. Comment will be visible to the person who wrote it and their friends. |
H: Why pictures of Google Photos also show in Picasa Web frontend?
I know they now shut down Picasa as in favor for the new Google Photos. I never used Picasa, but now uploaded a few pictures lately to Google Photos.
But indeed when I visit https://picasaweb.google.com/home all the pictures from Google Photos show up there as well.
Is that a normal behaviour?
And more more point: Even though I only have very few albums created in Google Photos, in Picasa I see quite a lot of albums, named by dates. So for every date for which there are photos uploaded, one album is created in Picasa. Seems weird to me.
AI: Yes, it's normal. Google Photos and Picasaweb (and presumably Google+ Photos) all simply use the same data store. I can't imagine that they would have wanted to copy all those petabytes of images from one place to another; better to just create a new app to point to the old data. |
H: Apply formula to a numeric part of cell value
In a Google Spreadsheet, I have a column with values like T1, T2, T13 (i.e. all values starting with the same text prefix). I would like to use a formula on the numerical part of the values of these cells (for conditional formatting). Can I somehow apply it only to the numeric part of the value, i.e. 1, 2, 13? I would like to change the background colour for the cell containing the maximum numeric part of the value?
I know how to extract the numeric part. E.g., if the T-values are in column A, cell B3 can contain this equation:
=if(len(A3)>1,value(right(A3, len(A3)-1)),0)
However I fail to apply any further formula to this. E.g. this doesn't work:
=max(if(len(A2:A)>1,value(right(A2:A, len(A2:A)-1)),0))
AI: Following hints in the answer by Aurielle, I've been able to produce a shorter formula:
=(A2:A)=text(max(arrayformula(value(substitute(A2:A,"T","")))), "T#")
It assumes that the first row is occupied by table caption.
Break down:
substitute(text,"T","") removes letter T from a cell text text.
value() converts the text result of substitute to a number.
arrayformula() applies value(substitute()) to each value from A2, A3, etc. range. The result is a numeric array.
max() returns the maximum value of that array.
text(number, "T#") converts the found maximum value to a string prefixed with letter T. T# is the format string, meaning "letter T, then number".
Finally, A2:A=... compares the values from A2, A3, etc. to the formed string. For the cells matching T+maximum value, the comparison will return TRUE, and conditional formatting will be applied. |
H: How do you find nearby supermarkets on Google Maps?
In my country (UK) thousands of tiny local convenience stores have the word "supermarket" in their names, so whenever I need to find a supermarket, Google Maps is pretty much useless.
Is there any way to tell Google Maps to find actual supermarkets? i.e. the kind of big store that is commonly meant by the word 'supermarket', not small little shops
AI: Good question, but I don't think there is currently a perfect answer to this. Google Maps doesn't know if one supermarket is more "actual" than another. What would be the criteria? Even if you wanted to draw up a list of "actual supermarkets" it would be very subjective. That's still what we do with options 2 and 3.
Option 1
Search for a supermarket that is a superstore supermarket superstore and you will be sure to get big supermarkets. However you won't get the medium size ones.
Option 2 (gives good results)
Search for the known supermarket chains, remove the ones which may be categorized as "convenience stores" or have "local" or "express" in their names.
supermarket AND (superstore
OR aldi OR asda OR budgens OR cooltrader OR "the co-operative food" OR farmfoods
OR "fulton's foods" OR "heron foods" OR iceland OR lidl OR "mark's & spencer"
OR morrisons OR ocado OR "sainsbury's" OR tesco OR waitrose)
-local -express -convenience
Tried it for my area and I can't see any small shops.
Option 3
If you are in a hurry, on mobile or if you don't like the idea of using brand names (because that's a list to update with time), we could do shorter. We would get more results, but little shops would come back as our problem is that a place named "Supermarket" in the category "Supermarket" will appear no matter its size.
supermarket superstore -local -express -convenience |
H: Stop Gmail automatically checking for new mail
Using the web browser version of Gmail, is it possible to stop Gmail automatically checking for new mail?
Occasionally, I need to access my inbox to retrieve information but don't want to be distracted by new email.
Before switching to Gmail, I was able to do this via Mac Mail App ('Take All Accounts Offline' feature) and am looking for something similar.
AI: No, not really. There's no setting within Gmail that would let you turn off retrieval of new mail while you have a network connection.
I can think of a couple of workarounds that could get you close to what you're after.
Use the Gmail Offline Chrome extension. It offers a slightly simplified view of your Gmail mailbox. It occasionally polls Gmail in the background as long as you have internet access and Chrome is running. You could then disconnect from the network and you'll still be able to access your Gmail. Once you restore connectivity it'll re-sync (sending/retrieving messages, deleting/moving messages).
Use a third-party mail client. This is probably your best option, since you would control when (and if) the client reaches out to retrieve messages. The Mac Mail app should be able to connect to Gmail with little problem.
Ultimately, you probably want to train yourself to ignore new messages when you're not ready to deal with them. You could always bookmark particular labels so that you go directly to that view rather than to the Inbox. (Example: https://mail.google.com/mail/u/0/#label/work-related) |
H: How to search reminders added to Google Calendar?
When I create a reminder in Google Calendar and then search for its description on the Google Calendar desktop webpage, nothing is shown. Only the "events" are shown.
It says:
0 result for ...
No events matched your search.
Is it possible to search for the reminders?
AI: This would seem to be an oversight on Google's part. Reminders don't appear to be searchable.
When you use the advanced search options, you can limit your search to a particular calendar (including "Other" calendars you've connected) or "All Calendars", but there's no option for "Reminders".
So it appears that there's currently no way to search for Reminders in Google Calendar.
As suggested at the Product Forum, you should use the "Feedback" tool to let the development team that this crucial bit of functionality is missing.
For what it's worth, if I search my calendar on my Android device, it does find Reminders. (It also works in Inbox by Gmail on my Android device.) |
H: Why is a blank string greater than 0 in Google Spreadsheets?
Why does
="" > 0
Evaluate to TRUE?
And how can I input a value that would evaluate to FALSE that is not a number?
AI: how can I input a value that would evaluate to FALSE that is not a
number?
Use ISNUMBER.
Syntax
ISNUMBER(value)
value - The value to be verified as a number.
*ISNUMBER returns TRUE if this is a number or a reference to a cell containing a numeric value and FALSE otherwise. |
H: How to view which sites I am signed in that use Google Course Builder
I recently registered to a site that uses Google Course Builder (more specifically Data Mining with WEKA) using my Google Account, but I cannot find any section in my Google Account Settings that lists the permissions that I have granted to this site and what sites like this I have granted permission in the past.
I have searched in this list as proposed by this answer but the site was not listed there.
Any ideas on where it is and how to view this list of sites?
AI: Short answer
You should ask for the name of the apps used on the related course to each course responsible.
Partial explanation
Google Course Builder isn't a Web App. It's software and guidelines that could be used to create online courses which in turn could work as web apps. Each course could include one or several components that requires user authorization but the name of each component depend on each organization or even individuals behind each course / component.
Registration permission request
The following screen shot is shown to me after I clicked on the Registration link on Data Mining with WEKA
Quotes
From https://www.google.com/edu/openonline/course-builder/index.html
Course Builder is an Open Source (Apache 2.0), online education
platform. Use it to create your online course whether it's for an
entire university offering, professional training, or a corporate
product.
From https://www.google.com/edu/openonline/course-builder/docs/1.10/create-a-course/add-content/google-drive.html
OAuth consent screen details
When your site requires access to private data (such as a file on
Google Drive), the owner of the account will be asked to consent to
the access. To prepare the consent screen to ask for access, you must
provide a product name and an email address.
Click the OAuth consent screen tab.
Fill out the fields:
For Email address, select one of the valid addresses.
For Product name show to users, enter the name of your course or site.
Considering ignoring the other fields, which are optional.
Click Save. |
H: How do I delete a file I own for just me?
On Google Drive, I own several big files that are in someone else's shared folder. I want the collaborators to still have the files but I want my storage space back. The options for each member of the list of collaborators under advanced sharing options never shows the change owner option. I assume if I delete the files and remove them from my trash to reclaim the storage, they will be deleted for everyone. How can I work around these hurdles to delete these files from my Drive?
AI: The ownership of files only could be transferred for Google own file formats. The ownership of files on other formats like images, videos, PDF, etc. can't be transferred. The alternative is that another user make a copy of those files and share them with the other users.
If your files are on Google file formats, first you have to share those files with an specific user, then you could transfer the ownership of that file to that user. For further details see Change your sharing settings. |
H: How can I use Google Inbox's "snooze" in regular Gmail?
Is there a way to "snooze" an email within Gmail without going to Google Inbox? Do some apps support it but not others? I'm interested in the Gmail web app, in particular (mail.google.com).
AI: Not without using a third-party app, or using something like a label with a date. You'd still need to manually move the messages back to your inbox.
See also: How to find an email in Gmail that was snoozed in Google Inbox? |
H: Display results when a string is not in a range
On this worksheet I am trying to see if the data in column B is not in the lookup list in column C. If the data from column B is not there, then I want to print the respective value from column A. I have the following formula in column E:
=FILTER(A2:A,REGEXMATCH(B2:B,JOIN("|",ARRAY_CONSTRAIN(C2:C,COUNTA(C2:C),1)))=false)
The issue is that I have blank rows in column C and the REGEXMATCH is counting the blank as a .*. Is there any way around this?
AI: Indeed, when forming regular expressions using join("|", C2:C), it is imperative to avoid blank cells in the range. To do this, filter the range:
join("|", filter(C2:C, len(C2:C)))
The reason for using len here is that it returns 0, interpreted as False, for empty cells, and nonzero numbers, interpreted as True, for other cells. |
H: How to get rid of special " and ' characters in Google Docs
Sometimes I want to type up tests into Google Docs and share with colleagues. But I find myself having to send these texts as .txt files later, after replacing these fancy " and ' characters.
I want the straight "normal" kinds, so I can feed the typed text into a shell, or script, and so on. An example:
What I want when I type using the " / ' key:
requests.get("http://example.com")
requests.get('http://example.com')
What google drive gives me:
requests.get(“Example.com”)
requests.get(‘Example.com’)
See how there are SIX types of quote marks? I want to make it so when I type ", I get " and not “ or ” ... the difference may be easier to see l
larger:
yes: " ' no: “ ” ‘ ’
Man I hate these curly slanty quote things.
I would honestly like to ban them on any editor I use - trying to debug one of these weird quote marks isn't always easy! If you don't do any scripting/programming, the need for this won't likely make sense.
Is there a way to stop Google Docs from inserting these slanted quotes instead of the straight, shell-recognized type? Or am I stuck emailing plain text files in both line endings so I can send out my tests to the team?
AI: Click on "Preferences" under the "Tools" menu in an open document, then uncheck "Use Smart Quotes".
This setting is global, so it will affect all of your documents in Google Docs. |
H: Generating multiple random numbers in a single cell
I am attempting to create a sheet that reads a cell and generates a set of random numbers based on that cell's length
I have a long list of one to four random numbers, in the format below.
4
2 2
0 4
4 0 0
3 1 0
0 0 4
4 0 0 0
3 0 0 1
2 2 0 0
One of these numbers will be picked at random by another process. I need to generate another random number between 1-4 for each of those numbers. If three numbers are chosen, I need to generate three more numbers. If only one number is chosen, then I need to generate one more number.
I'm not sure how to do this, as I don't appear to be able to use more than one RANDBETWEEN per cell.
AI: If the string you're starting with, say 3 1 0, is in cell A1, the following function generates a random string such as 1 4 1.
=left(join(" ", {randbetween(1,4); randbetween(1,4); randbetween(1,4); randbetween(1,4)}), len(A1))
The idea is to generate an array of four random numbers, join it into a space-separated string, and then cut the part of the string of the same length as the input. |
H: How precise are Wolfram Alpha's mathematical calculations?
I recently started learning about floating point arithmetic and a how computers have limited precision when dealing with such calculations.
To what degree of accuracy can Wolfram alpha output computations?
I was hoping to check the accuracy of some calculations in C++ by comparing them to answers outputted by Wolfram Alpha.
AI: When requesting sqrt(2) with "more digits" Wolfram Alpha outputs
which far exceeds the accuracy of double-precision floating point variables (in which sqrt(2) is 1.4142135623730951).
WA is also smart about the organization of computation, preventing the loss of significant digits. For example, sqrt(10^100+1)-10^50 outputs a correct value, slightly less than 5e-51. Straightforward execution of the same computation is likely to return exactly 0.
So, the answer is yes: it is reasonable to check the accuracy of floating point computations using Wolfram Alpha. |
H: Create a sparkline for the delta between each column of data
Lets say I have data like so...
A B C D E
50 100 125 175 225
I want to create a sparkline that will show the difference between each column
SPARKLINE( [B-A, C-B, D-C, E-D])
But, I don't want to make my spreadsheet have 2x the number of rows in order to calculate the intermediate result.
Is there a function that will take a range of cells and return an array after apply some math on the input range?
Edit: Solution proposed worked perfectly... Here's what it looks like when applied.
AI: Use arrayformula to perform operations on arrays, for example
=sparkline(arrayformula(B2:E2 - A2:D2))
plots the sparkline of differences B2-A2,..., E2-D2. |
H: How to update row in Spreadsheet based on respective cell value?
I'm about 10 days new to coding in GScripts/Spreadsheets and I've been struggling to write a Spreadsheet function that will change the values of certain cells in certain rows depending on the value of the cell in the last column of it's respective row as it receives updates through a linked form.
In other words, if cell A5 of the incoming row reads "Recovering", I want it to clear cells A2 and A3 and change cell A5 (itself) to "RECOVERED!".
The code I've written so far looks like this:
function statCheck() {
var ss = SpreadsheetApp.getActive();
var range = ss.getActiveRange()
var rowEnd = range.getLastRow();
var columnEnd = range.getLastColumn();
for(var i = 2; i <= rowEnd; i++) { //skip 1, ignore column titles
var time = range.getCell(i, 1);
var firstname = range.getCell(i, 2);
var lastname = range.getCell(i, 3);
var tablet = range.getCell(i, 4);
var status = range.getCell(i, 5);
var value = status.getValue();
if (status.getValue() === "Recovering") {
firstname.clear();
lastname.clear();
status.setValue("RECOVERED!");
}
}
}
Which should change the value inside A5 to "RECOVERED!", but for some reason nothing happens after the code runs (no errors either).
If there is a way to do this entirely without Spreadsheet formulas, that's the way I'd like to get this done. Otherwise, any and all help is much appreciated!
AI: ss.getActiveRange() selects the currently selected or edited range. From reading your script I see you meant the entire range of data, which would be ss.getDataRange(). Other than that, the logic is okay.
Other suggestions:
Don't use methods when unnecessary, you get time and tablet that are never used.
Consider getting all relevant values in one getValues call, and then loop over the resulting JavaScript array, referring to individual cells with range.getCell(..).clear only when actually needed.
Consider running the script by a trigger on form submission, making use of the event object. This simplifies things a lot: see below.
function statCheck(e) {
if (e.values[4] === 'Recovering) {
e.range.offset(0, 1, 1, 2).clear();
e.range.offset(0, 4, 1, 1).setValue('RECOVERED!');
}
}
The index is 4 instead of 5 because JavaScript index is 0-based. |
H: Restrict the range of a script that replaces input data to a certain range
There is this question regarding adding checkbox functionality to Google Drive: Checkbox function to automatically add to total. And a great answer is:
In the Google Sheets spreadsheet go to Tools -> Script Editor.
Enter the following code:
function onEdit() {
if(SpreadsheetApp.getActiveRange().getValue() == 1) {
SpreadsheetApp.getActiveRange().setValue('=CHAR(10004)');
SpreadsheetApp.getActiveRange().setBackgroundRGB(0,255, 0);
}
if(SpreadsheetApp.getActiveRange().getValue() == 0) {
SpreadsheetApp.getActiveRange().setValue('=CHAR(10060)');
SpreadsheetApp.getActiveRange().setBackgroundRGB(255, 0, 0);
}
}
Enter into any cell a 1 for a tick, and a zero for a cross.
This code is great and it works beautifully, but I would like to know how to ONLY apply that to a range of cells and not to the whole spreadsheet.
By example, cells: G25 x I47
AI: In order to limit the range of a script, get the row and column of the active cell, and check that it falls within some bounds:
function onEdit(e) {
var row = e.range.getRow();
var col = e.range.getColumn();
if (col >= 7 && col <= 9 && row >= 25 && row <= 47) {
if (e.value == 1) {
e.range.setFormula('=CHAR(10004)');
e.range.setBackgroundRGB(0,255, 0);
}
if (e.value == 0) {
e.range.setFormula('=CHAR(10060)');
e.range.setBackgroundRGB(255, 0, 0);
}
}
(I also shortened the script using the event object.) |
H: Can I add the URL from a Facebook status update to a Google Spreadsheet with IFTTT
Would it be possible to save the actual URL where you can find the individual post to a new row in a Google Spreadsheet from Facebook to Google Drive Spreadsheets?
(You can get to the FB status URL by clicking the time/date). A URL could be:
https://www.facebook.com/zuck/posts/10102890573589151?pnref=story
(Zuckerberg's latest non-photo post).
I know there is an IFTTT recipe to add the actual content of a Facebook status update to a new row in a Google Spreadsheet including name poster and date added.
AI: Unfortunately, no. The only ingredients for a normal Facebook status update are "UpdatedAt", "Message", and "From".
A link status update does offer a "Link" ingredient, but that's the URL of the link you're posting, not the link to your status message. |
H: What options or tools can I use to have Gmail notify me on receipt of a very important message?
I am eagerly awaiting an important-to-me email notification. I currently have a filter set in Gmail to trap this message and flag it as important, never send it to spam, keep it in the inbox, and label it.
Once that email arrives is there anything I can do to make Gmail even more active or obnoxious to advise me of its arrival?
Can I generate a Hangouts message to myself when it shows up?
What is the current state of desktop notifications and can those notifications be bound to a specific filter?
AI: No, in Gmail web client you can't have a filter or particular message generate a Hangouts message or a desktop notification specific to that particular message.
In the Gmail Android app you can assign ringtones to labels. I've taken the steps below from this Google help article. I've used this combined with a filter to automatically assign the label to the incoming message for VIP emails in the past.
In the Gmail app, touch the menu Menu.
Touch Settings.
Choose an account.
Make sure that Notifications is checked.
Touch Manage labels.
Choose one of your labels.
Touch Sync messages and choose either Sync: Last 30 days or Sync: All.
Check Label notifications.
Choose how you want to be notified.
Repeat for any label you want notifications for. You can choose different ringtones for different labels.
Note: By default, notifications are on for Primary, so you may need to turn off its notifications. |
H: Conditional formatting for a single cell based on a row being empty or containing any values
I want A1 to go green if any cells in range B1:J1 contain any values.
A1 to remain blank if B1:J1 contain no values.
In the sheet all values will be text based but will vary from cell to cell.
AI: Use conditional formatting with custom formula
=len(join("", B1:1))
The join concatenates all the values in that row, starting with B1. The formatting applies if the length of the concatenated string is not zero. |
H: Lookup formula returns an incorrect answer
I've written a Google Sheets formula that looks like this:
=lookup(I6,
{"First", "Second", "Third", "Forth", "Fifth"},
{((D6-E6)*H6), (0.43*H6), ((D6-0.25-E6)*H6), ((D6-E6)*H6), ((D6-E6)*H6)})
And the condition for "First" works just fine but when I drag the formula down to other cells the formula fails even though "Second" exists and so on. What am I missing? The docs say the list has to be "sorted", I'm not quite sure what that means.
Here's an example.
AI: The docs say the list has to be "sorted"
Yes, this is the problem. lookup expects the range to be searched to contain a list that is sorted alphabetically (if it contains text strings) or by value (if it contains numbers). If this expectation fails, it will not tell you anything but will likely return a wrong result.
So you have two options.
(bad) Sort the search range alphabetically
Of course, you'll also need to rearrange the result range in the same way. The resulting formula is hard to read and maintain.
=lookup(I1,
{"Fifth", "First", "Fourth", "Second", "Sixth", "Third"},
{((D6-E6)*H6), ((D6-E6)*H6), ((D6-E6)*H6), (0.43*H6), ((D6-0.25-E6)*H6)})
(good) use hlookup instead, as the documentation itself suggests
This requires a little adjustment: only one array is given, but it has two rows: first for search, the second for results. The last two arguments indicate that the result is to be taken from the second row, and that the search range is not sorted (false).
=hlookup(I1,
{"First", "Second", "Third", "Forth", "Fifth", "Sixth";
(D6-E6)*H6, 0.43*H6, (D6-0.25-E6)*H6, (D6-E6)*H6, (D6-E6)*H6, L6*H6},
2, false)
(You also had a bunch of unnecessary parentheses there) |
H: Is there a way to highlight text in a received email in Gmail?
I'd like to be able to highlight portions of text in emails I receive from other people, in Gmail. When I reopen those emails (often large), I'd like to be able to see what portions of text I had previously highlighted.
AI: Not within the Gmail web client. I would recommend creating a Google Doc, pasting the contents of the message into it and marking it up there.
You could then take the URL of the Doc and put it in a reply to that Gmail thread addressed only to you as a quick way of referencing it in Gmail.
If a group of people are collaborating on this content, using a Google Doc instead of an email thread may be a faster, more efficient way of getting the work done. |
H: Getting the highest values for each day
I have a bunch of raw data in a spreadsheet - dozens of temperature readings a day. My ultimate goal is to graph the highs and lows of each day, filtering out all the other readings. So my data resembles to following:
Date Temperature
6/16/2016 6:00 71
6/16/2016 12:00 75
6/16/2016 18:00 73
6/17/2016 6:00 82
6/17/2016 12:00 76
6/17/2016 18:00 79
6/18/2016 6:00 73
6/18/2016 12:00 79
6/18/2016 18:00 84
To this end of building a chart, I am trying to filter out all the interstitial readings and output the results into another sheet. Sample output would be:
Date High Low
6/16/2016 75 71
6/17/2016 82 76
6/18/2016 84 73
I am using ARRAYFORMULA to get the high low for a given date range (i.e. Todays high is X and the low is Y), but I have been unable to build up a new, filtered dataset of only the highs and lows. I think I need another ARRAYFORMULA but that level of nesting is getting a little too Inception-y for me.
How can I produce a new dataset with only the max and minimum values for each day??
AI: This is the job for query function:
=query(A:B, "select todate(A), max(B), min(B) where A is not null group by todate(A) order by todate(A) asc label todate(A) 'Date', max(B) 'High', min(B) 'Low'", 1)
Here is the query string with line breaks for readability: it's mostly self-descriptive.
select todate(A), max(B), min(B)
where A is not null
group by todate(A)
order by todate(A) asc
label todate(A) 'Date', max(B) 'High', min(B) 'Low'
The "todate" command converts a date-time sheet object to a query date object. |
H: Paste hyperlink formulas but replace cell references with the actual values from the referenced cells
Consider the following:
A
B
C
=HYPERLINK(C2, B2)
Google
http://google.com
=HYPERLINK(C3, B3)
Facebook
http://facebook.com
=HYPERLINK(C4, B4)
Uber
http://uber.com
I wish to remove columns B & C after I have created the hyperlinks using the formulae, but then I get #REF! reference errors because the formulae rely on the data in those columns.
I tried copying column A and then using Paste Special > Paste Values Only but it didn't replace the cell references by their values. Nor did any other Paste Special option work any better.
Is there any way to copy the hyperlinks with the cell references replaced by their values?
AI: I describe two approaches.
Rich text
One way is to create a column of hyperlinks in Google Docs (or any other editor that supports hyperlinks) and then copy-paste it into a spreadsheet. The result will be hyperlinks which are rich text, not formulas.
Caveat: at present, there is no way to extract the URL from such hyperlinks with spreadsheet formulas or Apps Script. So if in the future you or someone else decides they need the list of these URLs, there'll be a problem.
Including data in formulas
Using Apps Script, one can fill column A with formulas such as =hyperlink("http://google.com", "Google") using the data from B,C. After running the script and verifying the result, B and C can be deleted.
function inlineHyperlinks() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("B2:C");
var values = range.getValues();
var formulas = [];
for (var i = 0; i < values.length; i++) {
if (values[i][0] && values[i][1]) {
formulas.push(['=hyperlink("'+ values[i][1] +'", "'+ values[i][0] +'")']);
}
else {
formulas.push(['']);
}
}
sheet.getRange(2, 1, formulas.length, 1).setFormulas(formulas);
}
Side-stepping the issue: hide the columns
This is the easiest: just hide the columns B,C and forget about them. |
H: Forbid managing lists
Is it possible to make nobody except board admin able to add and remove lists? I want users to be able to do everything with cards however.
AI: This currently not possible using the Trello permission system. They only expose options to customize who can create a board, invite, comment and vote. You can see the details on this Trello support page. |
H: What information does PayPal provide to vendors?
When paying for services with PayPal, what information does the seller have about the purchaser? Name? Country?
From their privacy policy:
Customer Service: for customer service purposes, including to help
service your accounts or resolve disputes (e.g., billing or
transactional).
Shipping: in connection with shipping and related services for
purchases made using PayPal.
Legal Compliance: to help them comply with anti-money laundering and
counter-terrorist financing verification requirements.
Service Providers: to enable service providers under contract with us
to support our business operations, such as fraud prevention, bill
collection, marketing, customer service and technology services. Our
contracts dictate that these service providers only use your
information in connection with the services they perform for us and
not for their own benefit.
which seems to mean everything with everyone, maybe?
AI: No, not everything with everyone. That would be wrong and insane
Here's from official documentation: (click on link to see everything, I'll just quote up a few paragraphs)
WITH OTHER PAYPAL USERS
When transacting with others, we may provide those parties with
information about you necessary to complete the transaction, such as
your name, account ID, contact details, shipping and billing address,
or other information needed to promote the reliability and security of
the transaction. If a transaction is held, fails, or is later
invalidated, we may also provide details of the unsuccessful
transaction. To facilitate dispute resolution, we may provide a buyer
with the seller’s address so that goods can be returned to the seller.
The receiving party is not allowed to use this information for
unrelated purposes, such as to directly market to you, unless you have
agreed to it. Contacting users with unwanted or threatening messages
is against our policies and constitutes a violation of our User
Agreement.
If someone is sending you money and enters your email address or phone
number, we will provide them your registered name so they can verify
they are sending the money to the correct account.
WITH THIRD PARTIES
Members of the PayPal corporate family, such as PayPal Credit, Venmo
or Braintree, to provide joint content, products, and services (such
as registration, transactions and customer support), to help detect
and prevent potentially illegal acts and violations of our policies,
and to guide decisions about their products, services, and
communications. Members of our corporate family will use this
information to send you marketing communications only if you have
requested their services. Financial institutions that we partner with
to jointly create and offer a product (including but not limited to,
the PayPal Extras credit card where we share information with
Synchrony Bank, for example, in connection with pre-approved offers
for the PayPal Extras credit card). These financial institutions may
only use this information to market PayPal-related products, unless
you have given consent for other uses. |
H: Switch from Inbox back to Gmail: how to convert pins back to stars
I'd like to try out Inbox, but I don't see how I can go back to Gmail if I do without a lot of manual pain. There doesn't seem to be a way to get back from pins to stars. Is there?
I know I can find starred items in Inbox, but can I star items in Inbox? Or is there a way to find pinned items while in Gmail?
AI: You cannot star items from Inbox, and you cannot pin items from Gmail. But you can find one from the other. After you find a list of them, it's easy to star all of the pinned messages or pin all of the starred messages (select all, do action).
You just need to search using "label:pinned" or "in:starred". Here are some examples of my searches.
Note: While you can label conversations in Inbox by clicking on the 3 vertical dots to the right of a conversation and using the "Move to" feature, "Starred" is not among the options for labels.
As for the other direction, I tried adding the "pinned" label to a message in normal Gmail but it looks like you have to create a new label that is in no way tied to the pinned status employed by Inbox. |
H: Is it possible to specify default volume size for new instances?
By default when I'm creating new instances (e.g. t2.small) via Vagrant all instances have the same volume size of 8GB.
Is there any option in AWS EC2 Console to change the default size on creation? For example to create 16GB each time when I'm creating a new instance?
AI: All instances are created from an Amazon Machine Image (AMI). The volume or volumes attached to a new instance are volumes created from the snapshots linked to the AMI, and that size determines the default size. If your instances have 8GB root volumes, that's the size of the root volume snapshot of the AMI.
When creating an instance you can, of course, specify larger (but not smaller) sizes for the volume(s), but that default isn't a "preference" that you can customize -- it's an attribute of the AMI you are using to launch.
You can, of course, create one instance from one of the stock AMIs, but with the volume size you want, then make a new, private, custom AMI from your new instance... and when you launch new machines using your custom AMI, the volumes will automatically be the size you wanted.
So, yes, you can get the behavior you want, but it's done using a mechanism other than what you had in mind. |
H: Transposing Column to Row
I am trying to write a script that will transpose a column from one sheet into a row on another sheet. I have already figured out how to do the copy, but I need to figure out how to change the data from vertical to horizontal on the other sheet. Can anyone help me?
AI: A column of values is represented in Apps Script as [['a'], ['b'], ['c']]. A row is represented as [['a', 'b', 'c']]. The following functions transform one to the other:
function col2row(column) {
return [column.map(function(row) {return row[0];})];
}
function row2col(row) {
return row[0].map(function(elem) {return [elem];});
} |
H: I don't use Google Plus – why do I have followers on my Google Account?
When I do a Privacy Checkup from my Google Account page, and examine the first setting 1. Control what others see about you, I see that I have a number of "Followers".
I am wondering why this happens, even though I don't have a Google Plus profile – at least not an active profile that I know of. When I go to Google Plus, I am met by an "Account upgrade to Google Plus" screen.
Questions:
Why do I have these "followers"?
How can I see who they are?
Most importantly, how can I remove/block the followers, and hinder new followers?
AI: The "Account upgrade" screen is something that Google+ put onto accounts about a year ago. It is asking if you wish to upgrade from the old Google+ screen layout to the new layout.
To paraphrase, it is not asking "Do you wish to have a Google+ account?", just "Do you want the new display for your existing Google+ account?".
Go past that screen, look at the People link on the left of the screen (New layout). You will be able to see the identity of your followers.
If you wish, you may then block their profiles.
From your Profile link, you can adjust your privacy settings to dissuade others. |
H: No more username available in Gmail?
Gmail has a serious problem about the possibility of creating new email addresses.
I was not able to create a name.surname account for the last three people I helped in the creation of an email address.
I think that the problems are two:
Gmail does not distinguish between name.surname and namesurname
many users have activated the address to access the services Android
Do you know if after a period of non-use usernames return available for Gmail?
AI: Do you know if after a period of non-use usernames return available
for Gmail?
No, they do not. And some Google services (e.g., Blogger) have promised that this will not happen.
However I do not see that there is a problem: we are not running out of numbers, so it will always be possible to get name.surnameNNN accounts, although NNN will become increasingly large. |
H: Can I use parentheses to group AND/OR operators in Gmail Filters?
When creating a new email filter in Gmail, can I group AND/OR operators within parentheses to create more advanced conditional rules? For example:
Has the words:
"Ebay" AND ("Guitar" OR "Drum" OR "Bass")
The above is supposed to filter mails that contain the exact word Ebay and one of the exact following: Guitar, Drum or Bass.
AI: AI E. is correct. AND is assumed, OR can be declared. This is according to the Gmail Help article on Advanced Search.
I recommend reviewing it as there are a lot of ways to improve your Gmail searches using the operators in it.
To address your specific example, you can drop the quotes & the AND operator. Quotes are only needed to search for an exact phrase.
Ebay (Guitar OR Drum OR Bass) would be the correct formatting for a Gmail search. |
H: Answer Google account disambiguation permanently
This is the message that Google gives whenever we sign in to YouTube. We know how this happened. Now we want to choose Business account forever instead of each time we sign in.
How do we choose Business Account and then have Google remember our answer forever?
Edit: Add the "Learn More" info. It explains how we created the conflicting account and not how to resolve the situation.
Edit: Add the result of choosing "Individual Account:"
What is a gtempaccount.com email address?
I am not able to recover the account because I do not:
know its password,
have access to a gtempaccount.com address,
know any information about that account's creation.
AI: Choose "Individual Google Account" and then change the email address for that account. For details see the related official help article Change your username
If you need to recover your individual account's password, follow these steps.
Click "Individual Google Account."
Click "Forgot Password."
Indicate that you do not know your most previous password.
Request a recovery email to the admin%shaunluttin.com@gtempaccount email.
Login to admin@shaunluttin.com to receive that email.
Then continue with the renaming process. |
H: Change the page color of a Google doc?
Is it possible to make the page black? (I'd then color the text white/colored.)
I love the Atom text editor by the people at Github, so this is taking a cue from them.
AI: Files > Page setup...
then choose "Page color". |
H: Gmail "send mail as" not working. No error messages
I'm an employee at a university. I've been having my emails automatically forwarded to my Gmail account. I've also been using Gmail's smtp server for over 4 years to "send mails as" my university account. This has worked just fine, until yesterday.
Emails are still forwarded from my university account to my Gmail, but none of my sent mails are going through at all. There are no error messages. I only discovered this when some of my colleagues told me they weren't receiving my messages. It's been over 24 hours.
The settings for "send mail as" on my gmail account are:
Mail is sent through: smtp.myuniversity.org
Secured connection on port 465 using SSL
AI: You haven't actually been sending mail through Google's SMTP relay. It's address is smtp-relay.gmail.com or smtp.gmail.com as seen here. The server at smtp.myuniversity.org would belong to myuniversity.org. You would need to contact whoever runs that server for help with this issue.
Additionally if Google's servers were rejecting your messages you would be seeing non-delivery or bounce back emails in your account for every message you attempted to send in this way. |
H: Auto insert column with today's date every day
I would like Google Sheets to insert a new column between columns A and B at the start of each new day with that day's date in cell B1. Is there a function or script that would make this possible?
AI: Use this script, adjusting the sheet name and date format if necessary. It should be entered in Script Editor, found in Tools menu. After saving the script file, go to Resources > Current project's triggers, and create a trigger to run the function newColumn daily, at your preferred time.
function newColumn() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Sheet1');
sheet.insertColumnAfter(1);
sheet.getRange("B1").setValue(new Date()).setNumberFormat('M/d/yyyy');
} |
H: How can I list my questions marked as needed improvement in Quora?
I wonder how I can list my all questions marked as needed improvement in Quora.
AI: As of now there is no such way. You can only list all your questions by clicking Questions on your profile. |
H: Insert>Equation does not recognise LaTeX "shortcuts" as per Google Docs help guide
In Google Docs, when I choose from the menu Insert>Equation, it displays literally shortcuts such as "\frac". For example, the following:
\frac {a}{b}
Should display a fraction with a over b. But it just shows the text above. What am I doing wrong? I have followed the usage defined and demonstrated here:
Google docs help - Insert and use equations in a document
HostMath Equation editor
AI: Despite mimicking some of the LaTeX syntax, Google Document Equation Editor is still WYSIWYG: changes to an equation happen immediately in response to key presses, there is no compilation stage. In particular, there are no { } for grouping: you control the placement of characters visually. Think of entering "\frac " as equivalent to clicking a button for "fraction pattern" in the toolbar.
To enter a fraction of the form a/b, type
\frac aTabbTab
The fraction structure appears first, with the cursor set in the numerator. After entering "a" there,pressing Tab
moves the cursor to the denominator. The second Tab moves it out of the denominator, so you can continue with the formula.
Instead of Tab, the right arrow key may be used. |
H: How can I find out my Facebook login name?
How can I find out my Facebook login name?
What must I enter here:
AI: If you're asking so that you can login to your account:
Use the "Forgotten account?" link. This allows you to get your information by using your:
Email
Phone number (if set up)
Username (which it sounds like you're looking for, so you would want to use one of the other options)
Full Name
You can also associate multiple emails to the same account, and you can choose whether each shows on your timeline. That way you can keep it up to date, but not have to worry about what your Friends can see.
If you can already login:
Once you login, you can view your username by clicking on your name at the top of Facebook (your user picture with your name next to it that takes you to your timeline). Once you're on your Timeline, the URL has your username.
If the URL says: https://www.facebook.com/hellomynameisjoe
Then your username is hellomynameisjoe. |
H: How can I receive email notifications about reactions to my own content on Facebook?
Which email notification settings do I need to enable to receive email notifications about reactions (comments) to my published posts and status messages?
AI: Here it is:
Settings -> Notifications -> Email -> All notifications, except the ones you unsubscribe from
This will notify you by email about reactions. There is no special settings for reactions. |
H: Transpose only one column in Google Spreadsheets
I have a sheet like this:
I want it to have two columns: in and out with the corresponding values:
I'm able to do so using sorting and copy-pasting, but as the data gets more complicated this way gets more complicated, and less safe, as well. Maybe there is a simple, correct way for such a transformation?
AI: You can use the following QUERY to obtain the result you want.
Formula
=QUERY(A1:C6, "SELECT A, MAX(C) GROUP BY A PIVOT B")
Screenshot
Example
I've created an example file for you: Transpose only one column in Google Spreadsheets |
H: How to activate 2-Factor Authorization with authenticator for a Google account?
When I want to add 2FA with the Google authenticator, Google always want to add 2FA with Phone verification instead.
I Googled it and all articles are mentioning the same URL, which asks for a phone number instead of generating an authenticator key.
What do it need to do, to activate the authenticator verification instead of phone/SMS verification?
AI: Even to activate the Authenticator, first you need to complete SMS/Voice setup.
Then, follow the directions for your type of device explained on Google Help page for 2-Step Verification.
Read this Make Your Email Hacker Proof for more understanding. |
H: How to use "split text to columns" when pasting in Google Sheets?
I have some CSV data in the clipboard that I'm trying to paste into a Google sheet (Chrome, Windows 7). There isn't really a direct paste option for CSV data (like the "Paste Unformatted Text" option in OpenOffice), but I noticed that sometimes a little clipboard icon appears and if you click it a menu with "split text to columns" comes up.
The problem I'm having is, I don't know how to activate this menu and do the actual paste:
Once I click "split text to columns" a separator selector pops up, then... I don't know what the next step is. Selecting a separator just leaves the pop up on the screen, Ctrl+V doesn't do anything, clicking elsewhere closes it, and I'm not sure how to perform the actual action.
So, two questions:
How do I actually perform this action?
What is it that triggers that little clipboard thing to come up? I can't actually control it, it just sometimes appears on its own.
I'm not looking for other ways to import CSV data, there are other working solutions e.g. saving to a file then importing. I'm specifically wondering about this context menu action.
AI: I took some test CSV data and pasted it into a Google Sheet. When I opened the clipboard and chose "split text to columns", my data was immediately split. There shouldn't be anything else you need to do.
Try with a smaller sub-set of the data. |
H: Pull info from a larger text string into separate cells with regular expressions
I'm new to using regular expressions and I'm trying to use REGEXEXTRACT to pull info from a larger text string into separate cells:
Men's T-Shirt (Amount: 6.00 USD, Qty: 1, Size: M, Color: Black)
I'd like three cells/columns returned (a separate formula for each column), one which returns the quantity ("Qty: 1"), one that returns the size ("Size: M") and one that returns the color ("Color: Black")
AI: IF you have the text for example in A1 you only need one formula to extract all 3 portions:
=REGEXEXTRACT(A2,".*Qty: (\d+),.*Size: (\w+),.*Color: (\w+)")
To explain a little:
Anything you enclose in it's own capture group or set of parentheses, automatically gets pushed to the next cell. For each type, as long as the remaining data you see in the formula is consistent for all your cells, it should work fine.
ADDITION:
If I understand your second question correctly I think this is what you want - the only other major change, is that you run the array formula so that it's dynamic you do have separate them to 3 formulas - but yes you can nest them. You can also have the shirt type query dynamic - for example in my image i put "Baby's T-shirts" in the cell above the results, just as an example, if you change that cell to Men's it pulls in Men's, so you could hypothetically change that to anything you want:
The three formulas are:
=ARRAYFORMULA(IF(ISTEXT(QUERY(A3:A,"select A where A contains """&B1&"""")),REGEXEXTRACT(QUERY(A3:A,"select A where A contains """&B1&""""),".*Qty: (\d+),.*Size:"),))
=ARRAYFORMULA(IF(ISTEXT(QUERY(A3:A,"select A where A contains """&B1&"""")),REGEXEXTRACT(QUERY(A3:A,"select A where A contains """&B1&""""),"Size: (\w+),.*Color"),))
=ARRAYFORMULA(IF(ISTEXT(QUERY(A3:A,"select A where A contains """&B1&"""")),REGEXEXTRACT(QUERY(A3:A,"select A where A contains """&B1&""""),"Color: (.*)\)"),))
It looks like this in the end: |
H: Nesting a Function Within a Logical Statement in Google Sheets
Is it possible to include a formula as the value_if_true within a logical statement in a cell in Google sheets? For instance, I would like to subtract the two rightmost digits in two adjacent cells, if that value in E23 is greater than the value in D23. I know how to return a yes or no:
=IF(RIGHT(E23,2)>RIGHT(D23,2),"YES","NO")
but can I perform an operation if the value is true? I've (blindly) tried:
=IF(RIGHT(E23,2)>RIGHT(D23,2),=RIGHT(E23,2)-RIGHT(D23,2),"NO")
but of course, that returns an error. How would I perform the equivalent of that function for a true value?
AI: =IF(RIGHT(E23,2)>RIGHT(D23,2),RIGHT(E23,2)-RIGHT(D23,2),"NO")
"=" not required inside if statement. |
H: Conditional Formatting if all cells fail to meet a certain criteria
This is the spreadsheet I'm working on. I am trying to figure out a formula for conditional formatting so that it only highlights the cells in red if none of the cells from columns N to Y of the Failed tab says either "Yes, I take this medication within the specified dosage range" or "I am unsure If I take this".
AI: After selecting the range N2:Y, apply to it conditional formatting with "Custom formula is:"
=sum(arrayformula(n(regexmatch($N2:$Y2, "Yes, I take this medication within the specified dosage range|I am unsure If I take this")))) = 0
Explanation: $N2:$Y2 refers to the range N-Y in the current row. regexmatch($N2:$Y2, "this|that") returns True when the cell contains either "this" or "that" (this is a substring search, which is appropriate in your case). Then N converts True to 1 and False to 0. The whole array of these 1-0 values is then summed, and the formatting applies if the sum is 0, meaning there were no matches. |
H: How to remove my account from the Chocolatey Gallery?
I would like to remove my account from Chocolatey Gallery:
My chocolatey packages are not updated anymore as ketarin does not run as my Windows laptop is broken
Since November 2015 I am not using Windows anymore and I have decided to continue using linux
I receive multiple messages whether packages could be updated on Chocolatey
I would like to transfer ownership so other maintainers could update the packages
Alternative
I could continue, but then I would like to use an open source windows system in the cloud for free so the packages could be updated automatically
I have searched the web, I have logged in to chocolatey gallary but did not find a button to remove my account.
AI: Typically you use the contact us form or use contact site admins from a package page to remove your account. |
H: How does Gmail calculate the size of a message which contains an attachment?
I am getting rejection on my 13.5MB attachment even though size limit is 15MB. So, I want to know the exact policy by Gmail, as in how do they calculate the size of an email which contains attachment?
AI: The 15MB limit is for the entire message, not just attachments.
To check the size of a message, open it, and select Show Original from the menu in the upper right. This opens the entire message in a new tab/window. Save this to a plain text file and the size of that file is the total size of the message.
Tl;dr: If Gmail says your message is too big, you'll have to make it smaller. Try sharing the file via Drive or Dropbox and emailing a link. |
H: Can Google Apps account be recovered after org went under, but account is still alive?
My problems is 2 Factor Authentication.
I was part of a loose online organization which disbanded 2+ years ago, but our mail/docs are still available. I thought I'd log in and check what we were doing (for old times sake).
After entering my email and password, it prompts me to enter a code it sends via sms, but my number has changed well over a year ago (moved countries).
It's been so long ago, I don't think I can make contact with anyone with some sort of administrative privileges. When I click login by other means, it takes me to a page where I can select "request help from Google", but it only takes me to a generic page telling me to contact the administrators.
It's not super crucial, but is there a way I could somehow regain access to my account?
AI: No, for a Google Apps (Enterprise) account it is expected your Admin would allow you back in as they own the account and are paying for the licence cost.
If it were a consumer Gmail account you would be presented with an option to supply additional info that Google would review and decide if you are the actual owner of that account. |
H: How to download Google Search history?
Google Takeout used to give an option of exporting your all Google search history in .json file, but today when I created an archive of my data, it said at bottom:
Note: Your past searches aren't included when you create an archive. Find out how to download your past searches.
On following this support page link, it says:
Visit your Web & App Activity page.
In the top right corner of the page, touch Menu More> Download searches.
Choose Create Archive.
When the download is complete, you’ll get an email confirmation with a link to the data.
When I go to history.google.com link, it gets forwarded to myactivity.google.com, & there in the three dot hamburger menu on the right-top, there is no Download option in it?
In 2012 geeklad.com used to have a way by using flash file & some codes, but that also does not work now.
Is there a way to download your Google History as of today?
AI: From the MyActivity page, I chose "Other Google activity" from the menu.
At the bottom of that page is a section:
Download your past searches
Create an archive of all your past searches with Google Takeout
When you click "Get Started", you're informed:
Download a copy of your data
Please read this carefully, it's not the usual yada yada.
Create an archive of your past searches. This archive will only be accessible to you. We will email you when the archive is ready to download from Google Drive. Learn more
Important information about your Google data archives
Do not download your archive on public computers and ensure your archive is always under your control; your archive contains sensitive data.
Protect your account and sensitive data with 2-Step Verification; helping keep bad guys out, even if they have your password.
If you have decided to take your data elsewhere, please research the data export policies of your destination. Otherwise, if you ever want to leave the service, you may have to leave your data behind.
With a "Create Archive" button. Once you click that, you're given a message that you'll be notified when your archive is ready. Simply wait. (It took less than an hour for me to get my notification.)
The archive is a zip file with an index.html file and a set of JSON files, one for each quarter.
If any of that isn't available to you, it just hasn't been rolled out to your location yet. |
H: Formula referencing the last column in sheet
Each week I add a new column to a spreadsheet and then need to update several formulas to calculate the delta between the last column and the column to the left of it.
I haven't figured out a way to get the value from that column so i can do math on it. The other solutions i found would let me reference that column...
AI: To determine the last column, one should decide in what row to measure it. Suppose it's the 2nd row; then the last column number is
=max(filter(column(K2:2), len(K2:2)))
where I put K to avoid circular dependency, since this formula will also affect some cells in row 2, to the left of column K. I'd put the above formula in some cell, e.g., E1 (or on another sheet), and then use it in computations like this:
=arrayformula(filter(K2:27, column(K2:2)=E1) - filter(K2:27, column(K2:2)=E1-1))
This takes the difference between the last and second-to-last columns.
Instead of filter, one could incorporate column number in formulas by using indirect with R1C1 notation, but that seems more complicated to me. |
H: How to set up meetings/appointments through time slots using Google Forms
I am creating a form response, using Google forms. The module should be posted on my (Google) website and should be used by people to set meetings with me.
I provide some options regarding the periods I am available.
Indeed I set up a question: "When do you want to meet me" and I am providing multiple answers.
My question is this. Suppose I indicate that I am free Monday and Tuesday at 10:00. Someone will decide to book the meeting with me on Monday. Is it possible to drop automatically Monday at 10:00 from the multiple answers, such that a second person will not pick up exactly the same time chosen by someone else?
If this is not possible, is there any other option that can do what I need?
AI: There are different ways of achieving the above.
Manually
You can find a more general post about how to manually accomplish it over at Stackoverflow: remove selected items from google form dropdown list.
Using an add-on
Another way would be by using one of the free add-ons:
Choice Eliminator 2 or
Choice Eliminator light
Both by Bjorn Behrendt offered at the Google web store scripted just for such needs.
Please have a look at this thorough YouTube video list on how to use them.
In your case, I believe that "Choice Eliminator light" should be sufficient.
Should you face any issues using any of the add-ons, there is a very active Google Plus Community you can turn to.
Keep in mind though: One of the main caveats of what you are trying to achieve (either manually or through an add-on) is the time lapse between form submission and scripts execution. Most of the errors occurring are when submissions fall into that space in time resulting overlapping issues. |
H: Google Sheets formula for "if contains"
I'm trying to figure out how to identify IF a list of items in one cell containing a value or string.
EXAMPLE
Cell A1 contains sites, sheets, docs, slides.
I want cell B1 to display a 1 'if' cell A1 contains the string sites.
FORMULA
=if(A1 ?????? "sites", 1,0)
I'm unsure what to replace the ?????? within the above formula OR if this formula is possible. Any ideas on how to accomplish the desired outcome are greatly appreciated.
AI: You can use REGEXMATCH:
=IF(REGEXMATCH(A1, "sites"), 1, 0)
To explain, REGEXMATCH returns true if and only if the argument is a substring of your string. |
H: Facebook to tell that a friend that also works in same workplace?
When adding a workplace, we have the popup window that allow to add friends who also work there as attached snapshot. I want to add more friends but it seems to be nowhere for us to do so i.e. the popup shown only once when adding workplace.
So I ask here, how to add more Facebook friends to a workplace?
AI: Click on edit from dropdown in that workplace where do you want add more friends. Change the audience and click on Save Changes, you will get that popup window, select you friend and save this.
Something here to note, changing audience means if you have set it friends, change it public or if you have set it public, change it to friends. Later you can change your audience anytime.
To see that popup window, do this process after some interval. After first change it will show but immediately if you make changes again it will not show. |
H: How can I get a Google spreadsheet cell or range reference dynamically?
I can explicitly reference cell G42 or range A42:G42.
But what if I need something dynamic?
For example: I want to write an expression in cell G200, which would calculate the average of cells A42:G42, without explicitly writing A42:G42, but by taking the value of cell G201, which is 42, finding "G" by seeing in which column the current cell is and finding "A" by going seven columns back from column G.
Is this possible?
AI: This can be done by using indirect in R1C1 notation. The following formula matches your situation:
=indirect("R" & G201 & "C" & column()-6 & ":R" & G201 & "C" & column(), False)
The range is described by a string formed by concatenating
R<row number>C<column number>:R<row number>C<column number>
The row numbers are taken from G201, the column numbers are computed with the column() function that returns the column number of current cell. (By the way, A is 6 places to the left of G, not seven) |
H: Easy to read Google search URL agurment _Image Tab Results_: q=how+to+create+google+search+url+argument+open+images+view+only
I like to be able to create easy to read URLs and I want to know how to modify the google search URL so that the results return showing the _image_I cannot see how to open Google results on images tab only. I'd basically like to create a URL that reduces keystrokes or usage of the mouse. I'd also like it to be readable and easy to create. :-)
I can create a simple URL such as:
https://www.google.co.uk/#q=how%20to%20create%20google%20search%20url%20argument%20open%20images%20view%20only
Or more readable like in the question title above:
q=how+to+create+google+search+url+argument+open+images+view+only
But, is there a query string parameter that I can add so the results returned open on the image view as a first visible choice? I don't know how to do that with Google? :-(
Added bonus: Trying to open the results on this search! >.<
https://www.google.co.uk/#q=gif+baby+koala
AI: https://www.google.co.uk/search?q=gif+baby+koala&tbm=isch
The parameter you need is tbm=isch (which I imagine stands for "image search"). |
H: Use I'm-Feeling-Lucky type URL on 3rd party website
An answer to this post explains that it is possible to use a URL to link somebody to the first web page in a Google Search result, like "I'm feeling lucky" does. For example https://www.google.com/search?btnI=I&q=your+query will take you to the first search result for "your query".
I want to do a similar thing for the search engine on a particular website: culpa.info. Culpa has a search engine of its own, and I want to be able to link someone to the first result of a search query.
I've attempted the same thing as with Google by using: http://www.culpa.info/search?q=mdes
but no search is even attempted. I am given the prompt:
Please search for something a bit more substantial.
I only get the same result when using the actual search bar if I use a character like "@" or "$" or some other special characters. This also happens if the search bar is blank and you hit "search".
Why might this be happening?
Is it because I am using the wrong encoding or something?
How could I change my URL so that Culpa would successfully return the first result of the query for a search for mdes?
AI: Part of the problem is that the search URL has to be constructed this way:
http://www.culpa.info/search?search=mdes
The other part is that unless their search engine has a feature to just return the first record from a search, you're not going to be able to do what you want. "I'm feeling lucky" is a feature of Google Search. Search engines don't all have the same features.
I don't even think they're using a search engine; it looks like it's just a simple database query on the back-end.
You'll need to direct your question/feature request to the managers of the site. |
H: Copy a column with mixed currencies using Google Apps Script
I have a google spreadsheet tab that needs to be copied to another sheet. In most columns I can set the formatting to the proper currency formatting, so when copying the column, the format is kept and the data is copied correctly.
In one of the columns I have some of the cells in one currency, and some other cells in another currency, therefore I cannot apply a currency formatting to this column, and this column has an automatic formatting.
When copying this column, the numbers are copied as values without formatting and displayed as plain numbers.
I am copying the values with the CopyValuesToRange method.
Is there a way to copy the text as is - with the currency sign? Or maybe apply a conditional currency formatting for each cell based on the cell's text?
AI: The method copyValuesToRange does what its name suggests: copies values to range. You want to copy both the values and formatting. For this, use the copyTo method:
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getRange("A1:A5").copyTo(sheet.getRange("B1:B5"), {formatOnly: true});
sheet.getRange("A1:A5").copyTo(sheet.getRange("B1:B5"), {contentsOnly: true});
The first step, formatOnly: true, copies over the formatting. The second copies values only (static values, not the formulas that they came from). |
H: Can I use Google Calendar to manage absences and sick notes for a micro-school?
Context:
I'm starting a micro-school for 30-50 students.
We want to manage absences and sick notes electronically. Parents should be able to schedule future absences and excuse past absences for their children. Ideally they should also be able to see which classes and workshops their children have attended and which ones are still outstanding.
How can I synchronize one central Google Calendar (that only the administrators have access to) with 30-50 other Google Calendars, so that parents see only the absences & schedules for their own children?
AI: You can create a Google Calendar for each student, and then under Calendar Settings, choose Share This Calendar so that both school administrators and parents have read/write access to the calendar. You can add all of those students' calendars to the administrator's view, and even color by some grouping (class etc.) if you're not already using the color for some other categorization.
Probably you want to have two calendars for each student: one for absences and one for classes/workshops, so that the administrator can have a view of only the absence calendars that isn't cluttered by seeing lots of events for the students during class times. You could also use this distinction for different parental permissions (e.g. just read rather than write the student's class calendar). The set of calendars for classes etc. may take more work than the one for absences to integrate with any other system you're using to register the students for those classes. |
H: Autoincrement in Google Sheets based on Google Form submission
I'm trying to create an auto-generated unique ID# for each meetings being submitted via a Google Form.
The unique ID# solution must also meet the following requirements.
The ID# must be static (not tied to row number).
I need to be able to set a starting point other than "1" for the unique ID#'s.
I've tried the following solution, but it created ID#'s based on row # and if a row is removed, it duplicates a unique ID#.
Can I add an autoincrement field to a Google Spreadsheet based on a Google Form?
AI: This can be done with the following script: set a trigger "on form submit" for this function.
The customizable parameters are: the column number where to insert Id, and the initial Id. The function uses Script Properties to keep track of the used Id, so they will not be repeated.
function generateId(e) {
var columnNumber = 5;
var initialId = 42;
var sp = PropertiesService.getScriptProperties();
var id = sp.getProperty("Event Id") || initialId;
e.range.offset(0, columnNumber - 1, 1, 1).setValue(id);
sp.setProperty("Event Id", id + 1);
} |
H: Automatically "split text to column" using Google App Script
I'm trying to figure out "if" I can automatically "split text to column" using Google App Script and the trigger of "on Form Submit". If yes, can someone help me figure out the solution to following problem? If no, can someone please help me figure out an alternate solution?
I have a google form that is being used to enroll in professional development workshops. The workshop name being submitted via a google form has a Unique ID# in it. I need to copy or separate that unique ID# into another column.
Sample Workshop Text (Every workshop will be in this format)
Chromebook 101 | GHS | 8:00 am | ID#100103
The above string will be in cell B1 and I need to automatically copy or separate the value ID#100103 into cell C1. We will always be able to target the ID# as the place where the separation happens.
I know how to do this manually using the "data>split text into column", but I need this to be done automatically on form submission.
Any ideas?
AI: You don't need a script for this. Enter the following in C1:
=arrayformula(iferror(regexextract(B1:B, "ID#\d+")))
This will populate column C with Id numbers (where the data in B is available), leaving the rest blank. As more entries are submitted through the form, more Id numbers will be in column C.
Another version uses a second regexextract to drop the ID# part and keep only the digits:
=arrayformula(iferror(regexextract(regexextract(B1:B, "ID#\d+"), "\d+"))) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.