GoogleSheet ImportFeed only unique Headlines - google-sheets

IMPORTFEED("https://news.google.com/rss/search?q="Sony")
I'm query google news for the keyword "Sony" and in the IMPORTFEED formula, I want to only bring back unique headlines. I want to exclude duplicate headlines even if they are published by different news outlets.
For example, if the "New York Times and the New Yorker Magazine both published the headline "Sony is Awesome" then I want the IMPORTFEED to bring back only 1 of those headlines and it doesn't matter which publisher it wishes to use.

try:
=UNIQUE(IMPORTFEED("https://news.google.com/rss/search?q="Sony"))

Related

Imported data into Google Sheets, match and change one Column of Data

I have a google sheet that users input data on. These sheet has complete town names. Eventually the data they input gets uploaded into a program which has the town names abbreviated. Im looking for a way to automate basically doing find and replace.
Sheet1- Users input
Town
Data
Washington Town Center
123345
Washington Town Center
988765
Fairland Heights
12345
Sheet2 - Reference to the correct names for program.
User
Program
Washington Town Center
Washington Twn Ctr
Fairland Heights
Fair Heights
I basically need to replace the Town names in Sheet1 with the names the Program uses and then all data with that row. A new sheet worth of data is sent every week, so Im looking for the most efficient way to change those names.
I have tried using QUERY and FILTER but cannot seem to find the best way to go about this.QUERY would find all the matches and add as multiple rows as the user sheets can have multiple entries for same town
=QUERY('Sheet1'!A:G,"select * where A like '%"&A2&"%'",0)
you need VLOOKUP:
={INDEX(IFNA(VLOOKUP(Sheet1!A:A, Sheet2!A:B, 2, ))), Sheet1!B:G}

Is there a way of creating a data/info sorting system across sheets in Google Sheets?

So I am working on a Google Sheets project for a small business that I am going to be starting up. So I have Google sheet with 4 different sheets in it. Let me explain what each sheet is for:
1st sheet named "All Customers": This sheet will have a bunch of information about all the customers who are using our services (Name, Subject, Price, Location, Instructor).
The other 3 sheets are for the 3 instructors who would handle all the customers. The 3 instructors are Sam, Lucy, and Jason, and their Sheets are named Sam's Customers, Lucy's Customers, and Jason's Customers respectively.
I want a sorting system where I can put in the info of the customer in the "All customers" sheet and based on the instructor I assign to them, that customer's info gets sorted and appended into the assigned instructor's Sheet. SO here's an example:
Jordan who wants to learn math needs to pay $200 for tutoring by us. He is located in NY so I assign him to our instructor Lucy who resides in NY and can tutor him.
In this case, this is what the "All Customer" sheet would contain:
A B C D E
1 Name Subject Price Location Instructor
2 Jordan Math $200 NY Lucy
Now Based on the fact that Lucy was assigned as the instructor for Jordan, I want his select information to be added to the "Lucy's Customers" Sheet Like so:
A B C
1 Name Price Location
2Jordan $200 NY
That's what I'm trying to achieve. If Jordan was assigned Sam, the select information of Jordan would be added to the "Sam's Customer" sheet.
So I'd been at this for a while and based on my research I wasn't able to get anywhere. I was messing around with the following Formula: =IF(INDIRECT("All Customers!C1:C")="Lucy",INDIRECT("All Customers!A2:A")," ")
But I know this won't achieve what I'm doing.
Here is a link to the dummy spreadsheet for this project so anyone can mess around with it:
https://docs.google.com/spreadsheets/d/1TGS9thgt77DSLbOUC5V2tRyjrDqE9He5ET17bM7HhZU/edit?usp=sharing
The Query method works but it only mirrors the information. I have pre-made cells in the instructors' sheets where there are cells that record if the customers under that specific instructor has paid or not monthly. The query is basically mirroring the information instead of copy/pasting. So when I get rid of a customer or switch the instructor in the main record, it will disappear from under the respective instructor's sheet. If that's the case then the corresponding cells that record the monthly payments in the instructor's sheet will be messed up.
Any help would be appreciated. Thank You in advance!
I have introduced the queries in the sheet. Please have a look. The data can be retrieved using QUERY function of Google Sheets. example is given below
=QUERY('All Customers'!A:E,"SELECT A,C,D WHERE E CONTAINS 'Sam'",0).
Now, whenever you make new rows in "All Customers" sheet, data would automatically be updated in instructor sheet.
Hope it is clear.

Linking several contacts to a single ID in Google Sheets or R

Update I added a link to a Google sheet and the column id like to know how to create
https://docs.google.com/spreadsheets/d/1oIqPf1OffpeCeMJW6kMJztT3mAWCLBPE7f8Ohr066wo/edit?usp=sharing
I need to analyze communications between different team members and users and need a way to combine different contact methods into a single identifier. I have a sheet that lists all the different contact methods for a single person (email, slack, phone), but not a way to link that to the sheet that keeps track of communication. Here's how the problem is set up.
The first sheet has the method of contact for each row. So, if the same person was contacted once by email and then by phone, the email would be in one row and the phone number would be in the second row (both listed in the same column).
The second sheet would have the contacts identifier (a unique ID), along with their name, phone, email, and other contact info.
How would I create a column in the first sheet that lists the unique identifier associated with any type of contact to that person?
So, for instance, the ideal solution would have something like this for hypothetical two people (the third row represents another person, the first two rows are the same person).
Col1 ID
email#name 4
555-555-5555 4
SecondPerson 5
I'm familiar with both R and google sheets, so can take solutions to create this in either. Or, I can import them into an Airtable if that helps.
I tried to look up solutions for record linking, but since all of the contact types are listed in the same column, I couldn't find a solution. Thanks and let me know if I can make the question more clear.
=ARRAYFORMULA(IFERROR(VLOOKUP(B2:B, {contacts!B2:B,contacts!A2:A;
contacts!C2:C,contacts!A2:A;
contacts!D2:D,contacts!A2:A}, 2, 0) ))

Unique list of names, not located in two other lists

I have a google spreadsheet that is being used to develop student schedules. Students are separated into one of two "houses" of teachers on the grade level roster sheet, then each house is scheduled on another sheet in the workbook.
I need to generate a list of students who are marked for "beta" house on the grade level roster (students from all houses), but whose names are not yet listed on the house scheduling sheet.
I have tried
=Unique(Filter(Roster!A:A&A3:A30,Roster!B:B="Beta"))
as well as
=Filter(Roster!A:A,Roster!B:B="Beta",<>A3:A30)
I made some loose attempts with the Query function, but I really have no idea what I am doing with that function yet.
The reason for the inconsistent range sizes is that students with special needs are scheduled first, and then other students (Speech/504/ELL) are scheduled as another layer of the process.
The Grade level roster sheet:
The House scheduling sheet:
=Filter(Roster!A:A,Roster!B:B="Beta",ISNA(MATCH(Roster!A:A,A3:A30,0)))

Embed just a range of editable google spreadsheet

I have a google spreadsheet, and I give each of my users their own small range they can edit (just their own row, actually). Now I want to embed this sheet using iframes. How do I embed just a range of this editable spreadsheet? This line shows the desired range as I want it, but because of the "pubhtml?", it isn't editable:
src="https://docs.google.com/spreadsheets/d/1mjKXUsDs9EfqV9WztdfmNLm-sZwhphTieqEoBEHWce4/pubhtml?gid=0&single=true&widget=true&headers=false&range=a1%3Ah5&widget=false&chrome=false&rm=minimal"
When I change just the "pubhtml?" to "edit?", it becomes editable by those users as it should, but it shows me the entire sheet, including headers etc.:
src="https://docs.google.com/spreadsheets/d/1mjKXUsDs9EfqV9WztdfmNLm-sZwhphTieqEoBEHWce4/edit?gid=0&single=true&widget=true&headers=false&range=a1%3Ah5&widget=false&chrome=false&rm=minimal"
I can find a lot of (confusing) info on some of the parameters for embedding, but didn't find an answer to this problem. Or is it impossible?
(Note: I did find two similar questions, but they didn't answer my problem - or maybe I didn't understand the answers? :-)
Thanks,
Stef
Embedding Google Sheets does seem rather less intuitive than one might wish. But some research (remember, Google is your friend, unless perhaps if your name rhymes with Rump) and some trial and error have delivered a solution to your question.
The OP's plan is to provide each user with access to their own row for data entry. There are several ways that one might imagine that this could/would be done. The most obvious (to me) is simply to give the user access to "their row" on the master sheet - for instance, "user A" gets access to, say, row 53, "user B" gets access to row 17, and so on. This is quite easy to do (as we will see) BUT it is worthwhile/important that the user should also see the column headers. If, say, the column header is in row 1, then "user A" needs access to row 1 and row 53. Problem! We can give access to contiguous rows, but not to two discrete ranges. So this approach simply isn't possible - or at least I couldn't find a way to make it happen.
The approach that I took was to start with the master sheet. Then add one extra sheet for each user. For example, we add a sheet "User A", "User B" and so on. Each "User sheet" has only two rows of data. Row 1 contains column headers, Row 2 contains the user data - this gives us two contiguous rows that we can make accessible to the user. The cells in the master sheet change from containing hand-entered/hard-coded data to simple formulae that link to the appropriate column on the appropriate user sheet.
I don't believe that it is wise to give each user access to their own row (however it is that this might be done). In my opinion, the various security implications don't justify the risk. My strong recommendation would be that each user should have their own sheet (that is, a separate doc for each user). The user then gets access only to a limited number of rows in that sheet, and the master sheet (which is a separate file) contains formulae that pickup the data in the user sheet (also a separate file). With this approach, if a user manages to "screw up" (whatever/whenever/however - but you just know its gonna happen) then only their sheet (and the link to the master) is affected. This compares to an approach that would put the entire master spreadsheet at risk.
For the sake of completeness, I propose to address the various options - as eye-wateringly tedious as it may sound/be).
For the sake of reference, I created a Google sheet (so_46059687) as a stand-in for the OP's master sheet.
Non-editable embed - (Version1)
In this example, one can see but not edit the master sheet. The document includes two "User" sheets but these are not visible (by choice).
I found two documents from the Google forums very helpful "Embed Sheet and remove Titles and Scrolling bars" and "How to I edit the height/width of a google sheets embed code when embedding it on my website?"
Codepen example
<iframe width="100%" height="250" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vR-1keK8Wmyr4V6o6cjskLCetvsmbLeMsJuZViPpqkPck2-P2kCb4E4Ta_YMjbawz4lfgU_LVPFuqya/pubhtml?gid=0&single=true&widget=true&headers=false"></iframe>
Non-editable embed - (Version2)
This is a variation on a theme of version 1 except that one of the user sheet has been made visible. The second user sheet is not visible (by choice).
Codepen example
<iframe width="100%" height="250" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vR-1keK8Wmyr4V6o6cjskLCetvsmbLeMsJuZViPpqkPck2-P2kCb4E4Ta_YMjbawz4lfgU_LVPFuqya/pubhtml?widget=true&headers=false"></iframe>
Editable embed - (Option#1)
This scenario shows a solution to the OP's question. The user can edit the data for their row. There is a downside - the user has complete access to their sheet. They can use rows and columns other than the ones linked to the master sheet, they can add a sheet but worse, they can delete their sheet.
These two invaluable articles explained how to create an editable embed: Google Docs: Embedding editable Google Docs and How to: Embed an editable Google Docs sheet.
Codepen example
<iframe width="100%" height="400" src="https://docs.google.com/spreadsheets/d/1XqT5umvq2vzK7CEivVJXTJdKlBW07bP9nnMMWs2px_Y/edit?usp=sharing"></iframe>
There are some things to note:
The user sheet called "Fred" has been "Share[d]". In this case, I choose "Anyone with the Link" so that it works in the Codepen, but in practise I would set the permissions so that only nominated people could edit the sheet.
The mastersheet is padlocked which means it is visible, but not editable. Another option would have been to hide the master sheet altogether but I chose otherwise in order to demonstrate the options open to the owner.
Note that the other user sheet (called "Joe") is not visible (because it hasn't been shared").
Note that whatever is edited on the user sheet (called "Fred") is immediately updated in master (called "Coy_Summary")
As noted, the user can delete their sheet or add an extra sheet. However this article (and code) "Google Spreadsheet Script To Insert And Delete Sheets with Protection" is apparently quite effective. I haven't tried it - I'll leave that to others.
Editable embed - (Option#2)
This is an example of how my recommendation might work. Each user (in this case, "Brian") has their own file (sheet), and the Master sheet picks up the user data with "IMPORTRANGE" function. Another aspect is that the user is limited to just two rows (though nothing limits access to extra columns).
Refer Google sheet
The document "How to embed specific cells range when embedding a Google spreadsheet" is essential reading. It explains in details how to limit the range that is embedded. Brilliant! "How to Share only Specific Sheet/Single Tab in Google Spreadsheet?" was also valuable.
Codepen example
<iframe width="250" height="75" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSzsA_yrb2uBCXywikOAbWrLnnEPYazevavza7PmtX9C6-xNw4p31gtCRBiCyxYkxVK7aMAWY1xZJ2o/pubhtml/sheet?headers=false&gid=936292221&range=A1:C2"></iframe>
BTW, if you look at the master sheet in Codepen Option#1, you can see the actual "importrange" formulae.
This is the formula for "Item #" in Column B of the master sheet:
=importrange("https://docs.google.com/spreadsheets/d/1-HtjEawH7p45qKY5c0syIOnTF15endnG4L8wIIPEaAs/edit?usp=sharing", "Brian!b2:b2")
the closest i got was
<iframe width = 100% height="700" seamless frameborder="0" scrolling="yes"
src="https://yoursheetid?rm=minimal#gid=0/edit?"
</iframe>
i used the rm=minimal with the edit parameter
You may have to replace ? with & but it works - The only thing i cant get rid of is row and column headers
I'm using Google sites to embed items
Hope this helps

Resources