Background
I am making a Database of organiser names, which i want to update with a Google Form.
I already made a Form which feeds a Spreadsheet "Form Responses" sheet with the organiser details: Continent, Country and Chapter/City. The Database is already existing with current organisers, split into continent specific sheets, so i need to add new organisers from the form to this database. If a new organiser is from a new country/chapter, that needs to be added to the database as well.
Question
What formula can I use to feed the "Form Responses" sheet rows into the "Database" sheets, without having multiple rows of the same Country and Chapter? That is, add the "Organiser" column to an existing "Country" + "Chapter", or add the new "Country" + "Chapter" + "Organiser" to the bottom of the correct "Continent_Database".
Maybe the only way to do this might be to add all new rows from the "Form Responses" sheet to the bottom of the correct "Continent_Database", and merge the rows in the case of already existing Country + Chapter, in an additional sheet.
Example
Spreadsheet example with some test Form Responses and a "Africa_Database" example sheet:
https://docs.google.com/spreadsheets/d/1QaDNQp-HrbueQchmlXGSr7cFZ9r2x7ml148vSJL4Q0w/edit?usp=sharing
You could be looking to use a query here. In the case below 'A2' points a cell containing a country name. Transpose will convert a downward list to a horizontal and the query will get all names from column G where column C contains that the country in cell 'A2'
=transpose(QUERY('Form Respones'!B:G,"SELECT G WHERE C ='"&A2&"'",0))
Here is an example
Related
I'm working with google Sheets and I have a sheet call source Sheet where names are listed in Column A
ColumnA
John
Peter
etc
In a separate sheet (target sheet), i import this list'names (column A) and associate other information regarding each person.
Like this :
in cell A2 of Target sheet, i put this formula
=importrange("ID sheet";"source Sheet!A2:A")
So i get the same list which is what i wanted. To that list, i associated a couple of additional information regarding to each of them like
*Target Sheet*
Column A = names Column B = Age Column C = Occupation etc
When i remove a person in the source sheet, the target sheet is updated but the information which was associated to that person stays in the target sheet.
What can i do to remove automatically the info asoociated to a person (target sheet) once i remove someone from the Source sheet ?
I have a list of email subject lines with job roles on the left side, need to filter out roles like Assistant Manager, Manager, Civil Engineer, Project Manager to get the result.
Certain cells don't have the job role mentioned so to be left blank
The rows on the sheet need to remain intact so data can be analysed.
i tried using REGEXMATCH but it will not work for row5
is there a way to have a single formula, which includes all keywords for the whole list.
REGEXMATCH(B3, "assistant|manager")
I'm doing this on Google sheet and have shared the screenshot and the GoogleSheet file Link for reference.
I have made a copy of your sample data on this Support Sheet, that will exist in perpetuity.
On a tab called MK.Lookups, I built a table to use for your lookup words and returns. Then on the tab called MK.Idea, I placed this formula in cell B3 and dragged it down.
=IFERROR(INDEX(SPLIT(TEXTJOIN("|",TRUE,IF(REGEXMATCH(UPPER(B3),SUBSTITUTE(UPPER(MK.Lookups!C$2:C$20),", ","|")),MK.Lookups!B$2:B$20,)),"|"),1))
I also placed this formula in cell C1, which is an arrayformula that will populate for every row and doesn't need to be copied down the column.
={"Result";ARRAYFORMULA(IFERROR(INDEX(SPLIT(TRANSPOSE(TRIM(QUERY(IF(REGEXMATCH(TRANSPOSE(UPPER(A2:A)),SUBSTITUTE(UPPER(MK.Lookups!C$2:C$20),", ","|")),MK.Lookups!B$2:B$20&CHAR(10),),,9^9))),CHAR(10)),,1)))}
On Google form submission, I am trying to get a unique patient id in column A automatically whenever there is a response being submitted. You can also see the formula in the formula bar.
As of now, I am able to do it with the following google script but due to the trigger limit, it is not getting fulfilled as the COVID response is quite higher and requests are keep coming in.
function myFunction1() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];
var lr=sheet.getLastRow()
sheet.getRange(lr,1).setFormula('="PID"&row()-1');
}
If I add the formula to all cells in column A of this sheet, every time a new row is being inserted on form submission and the formula is NOT available for that row by default.
So, Is there a way that I can automate generating the PID automatically.? or any other smart ideas without the trigger option?
Alternative ARRAYFORMULA in cell A1:
=arrayformula({"Patient Unique ID #";if(B2:B<>"","PID"&row(A2:A)-1,iferror(1/0))})
"Patient Unique ID #" puts the title (Patient Unique ID #) in cell A1, then the ; returns the line.
If B is not empty then generate the unique ID as per "PID" and a unique number based on ROW() less 1. If B is empty, then nothing iferror(1/0).
In Google Sheets, this sort of thing is usually done with an array formula. I would recommend that you leave the 'Form Responses 1' sheet as is and insert the timestamps in a new sheet with something like this:
cell A1:
=arrayformula(
ifs(
row('Form Responses 1'!A1:A)) = 1, "Patient ID",
isnumber('Form Responses 1'!A1:A), row('Form Responses 1'!A1:A) - 1,
true, iferror(1/0)
)
)
cell B1:
={ 'Form Responses 1'!A1:Z }
If you absolutely want to insert the Patient ID column directly in the form responses sheet, you may want to place it on the right after the columns that get updated by the form.
An array formula is more reliable than using a function that runs on a trigger, but do note that the patient IDs will be dynamic and only remain valid as long as no rows are inserted or deleted in the data. The same is true with your current approach.
To get static IDs, use an on form submit trigger that writes an ID on a row when that row is first submitted. See the insertUniqueId_ script for one example — it runs on an on edit trigger, but can be modified to run on an on form submit trigger.
I am recording a macro to be used for .csv files in Google Sheets. Each contact has all the information in his row. Some of the contacts don't have an email.
I want to add to the macro a function that automatically cuts the rows that have no value in the "Email" column and paste them in the second sheet.
Right now I only managed to cut rows based on their numbers, but of course this only works with a specific dataset.
spreadsheet.getRange('42:57').activate();
spreadsheet.setCurrentCell(spreadsheet.getRange('K42'));
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('Without Email'), true);
spreadsheet.getRange('A2').activate();
spreadsheet.getRange('\'With Email\'!42:57').moveTo(spreadsheet.getActiveRange());
};
I would like to recreate the gmail to: type field but for entering in data to a spreadsheet. So if a person starts typing in an email address it will look at their contacts (and domain contacts) and show a filtered set of emails.
No you cant because there is no event to detect the user typing.
What you can do is add a menu item that looks at the active cell and attempt to do the autocomplete on the cell.
I wound up using Data Validation.
Get a CSV of the contacts.
Import those contacts into a sheet on the spreadsheet
use a formula similar to (= A1 & " " & B1) to create a filed that you want to search on. In my case I combined First Name and Last Name
Open a new sheet and right -click cell A1. Use data validation to pull from the column you created in the previous sheet.
just start typing in the box and it opens up like the to: field in an email box.
I did this with 400 names and saw no performance issue.