I had a Google form where people have selected options from a check list. e.g.
[] London / Manchester
[] Hong Kong
[] Paris
[] Rome
[] Other: [text]
My responses are in Google Sheets. Some people have selected options 1 to 4 as well as 'Other' and typed their message, e.g.
London / Manchester, Paris, I want to go to Tokyo
London / Manchester, Hong Kong
Paris, Singapore please
Amsterdam
How do I query my spreadsheet to select rows where people have typed a message in the Other option. Hence, the only rows that should show are:
London / Manchester, Paris, I want to go to Tokyo
Paris, Singapore please
Amsterdam
Thanks
UPDATE:
Alternatively, can I somehow filter out the rows using a list of keywords so it only shows text that was entered for Other?
So if a column had these values below, can I use a keyword list such as 'London / Manchester', 'Paris', 'Hong Kong' and 'Rome' to hide these rows but show if text was added to Other option?
London / Manchester, Paris, I want to go to Tokyo
London / Manchester, Hong Kong
Paris, Singapore please
Amsterdam
Thanks
You could try
=ArrayFormula(filter(A:A,len(regexreplace(A:A," ?(London / Manchester|Hong Kong|Paris|Rome),?",""))))
If you wanted to add more columns, you could either just put them in the filter e.g.
=ArrayFormula(filter(A:C,len(regexreplace(A:A," ?(London / Manchester|Hong Kong|Paris|Rome),?",""))))
or in a query e.g.
=ArrayFormula(query({A:C,len(regexreplace(A:A," ?(London / Manchester|Hong Kong|Paris|Rome),?",""))},"select Col1,Col2, Col3 where Col4>0"))
if column Other is D column you can try:
=QUERY(A:D; "where D is not null"; )
Related
Table 1
Employee
Country
John
USA
Davis
Australia
Maria
Australia
Nancy
USA
Table 2
Country
Employee
Clients
USA
??
Johnson
Twitter
FaceBook
IBM
RedHat
Phizer
?? should correspond to data from Table 1 with the Country filter.
For our example, it would be John, Nancy in the same cell, preferably in the next line (alt+enter)
John,
Nancy
I have tried to concatenate + transpose, but I am unable to make it work.
Moreover, I am unable to find any way to do the equivalent of sumif() in transpose.
On google-sheet you may try below formula-
=TEXTJOIN(CHAR(10),1,FILTER(A2:A,B2:B=H2))
CHAR(10) is for line break.
use:
=BYROW(D5:D10, LAMBDA(x, TEXTJOIN(CHAR(10), 1, IFERROR(FILTER(A:A, B:B=x)))))
In Excel use Pivot Tables:
Create a PivotTable to analyze worksheet data
Just take field Country and Employee into Rows section and Pivot Table will do the rest. Employees will not be in same cell, will be in different but it's the structure you want. And it's really really easy.
I am fairly new to Google sheets, and essentially what I am trying to do is remove all non-duplicate values that do not exist or is listed in another sheet or row - and also store the non-duplicate values somewhere else
In my example sheet here, I am trying to only keep the Alcohol names that are listed in column G
So in my case, I only want to keep the following records:
Alcohol Name Alcohol Type Origin
Martell Cognac France
Captain Morgans Rum Jamaica
Wray & Nephew Rum Jamaica
Hennessey Cognac France
Barcardi Rum Cuba
Courvoiser Cognac France
Famous Grouse Scotch Scotland
Jack Daniels Whisky USA
Grants Scotch Scotland
Ciroc Vodka France
I also want to keep any that did not appear in the list in a separate table like this:
Alcohol Name Alcohol Type Origin
Russian Standard Vodka Russia
Southern Comfort Bourbon USA
Ciroc Whisky France
At the moment I am having to manually check a longer list one by one and it is taking lot of time and my arm hurts..
If someone can please help me with sorting it such that it looks like this, would be great! I don't know if there are formulas we can use
Use this formula to only keep the Alcohol names that are listed in column G
=QUERY(A1:C," where A matches '"&TEXTJOIN("|",1,G2:G)&"' ",1)
To order them use
=QUERY(A1:C," where A matches '"&TEXTJOIN("|",1,G2:G)&"' order by A",1)
Use this to keep any that did not appear in the list in a separate table.
You see, you only put not in the formula
=QUERY(A1:C," where not A matches '"&TEXTJOIN("|",1,G2:G)&"' ",1)
I have sheet with three columns:
# date, name, destination
1.10. Joe, Prague
2.10. Joe, Paris
2.10. Joe, London
2.10. Bob, London
And I need to aggregate it using date and name. I.e., to have:
1.10. Joe, Prague
2.10. Joe, "Paris, London"
2.10. Bob, London
I tried various combination of QUERY, SELECT and GROUP BY and TEXTJOIN, but I cannot get the result I need. Is it even possible?
A possibility would be to
create a helper column e.g. (column D) wiht unique values:
=UNIQUE(A:A)
create a column that joins all the values in column C that correspond to each of the unique values in D:
=join(",",query(A1:D, "select C where A = "&D1&""))
I let the task of wrapping this into an array formula to someone else :-) Alternatively, you can just drag the results from the first cell down the bottom.
I have a requirement where I need to group certain columns and simulate drill down (expansion and collapse) for them without doing any changes in Subject Area / Repository.
We have measure columns revenues and a two geography columns Continent (values are Europe, Asia) and Country (Singapore, India, Japan, France, UK) in Subject Area.
Continent is heirarchial column. Europe includes France and UK. Asia includes Singaore, India and Japan. We need to create a Summary Region SIUK (containing Singapore, India and UK) and another Region FJ (containing France and Japan). Analysis output should not show original Continent names. Analysis output needs to have three columns Region, Country, Revenue. When region is expanded then Country column should show the different countries.
Example (Result before expanding i.e. clicking + )
Region Country Revenue
---------- ----------- --------------
SIUK(+) ALL 600
FJ(+) ALL 400
Result after expanding i.e. clicking +
Region Country Revenue
---------- ----------- --------------
SIUK(-)
Singapore 100
India 200
UK 300
FJ(-)
France 150
Japan 250
How can I do this?
You can use groups:
1 - Click the "New group" button in the results tab
2 - Use "SIUK" as Display Label and select Country from the "Values From" list
3 - Manually select the countries that belong to the "SIUK" regiĆ³n
4 - Repeat 1-3 for "FJ"
5 - Preview the report; notice that you can drill down to Country by clicking the group
Beginner's question : I am creating a Fusion Table with one of the columns being a column of tags, e.g. :
New York, London, Paris
Berlin, Tokyo
New York, Tokyo
Paris, Rome, Tokyo
Paris, Berlin, London
The Filter dropdown (blue) provides me with checkboxes for the 5 above examples, but allows me also to enter a specific text as a query. How must I proceed to enter the equivalent of :
Paris AND London (results 1 and 5)
Berlin OR Tokyo (results 2, 3, 4 and 5)
Paris NOT New York (results 4 and 5)
Thanks in advance
You can use the WHERE IN ('New York', 'London', 'Paris')
Your IN (xxx,xxx,xxx) will depend on list of cities. The IN operator implies an OR condition.
Not sure how an AND condition would work in your case. See: https://developers.google.com/fusiontables/docs/v1/sql-reference#Select and search for <column_condition>