How to Search for text in google spreadsheet - google-sheets

Please I need to write a query to search for a text from one columns in all cells of a column.
For example:
I need to pick every text from column B cells and try to find it in column A cells. if found do something. Can you help me?. This will be used for a thousand of rows.

You could put this in C1 and copy it down:
=iferror(if(match(B1,A:A,0)>0,"Do Something",""))
Here is a link to my test spreadsheet:
https://docs.google.com/spreadsheets/d/1W65pNPqqYA1fmvjQyferqOHzXbSyRIOV2XvF6MdMBmE/edit?usp=sharing

Related

Google sheets: Arrayformula with importrange

I'm trying to work with combined arrangeformula and importrange formulas. I want that from spreadsheet1:Table1 P4 value would be taken to spreadsheet2 C3 cell: Table2 and only when i add new link to column "L" it will put automatic value at C4. So i want to use arrangeformula so it will work on whole column, but i want to fix that from all the links i add it would take same "P4" value. Possible?
There is no solution. See link1 and link2
All you can is
={IFERROR(IMPORTRANGE($L3;"Lapas1!A2");"");
IFERROR(IMPORTRANGE($L4;"Lapas1!A2");"");
IFERROR(IMPORTRANGE($L5;"Lapas1!A2");"");
IFERROR(IMPORTRANGE($L6;"Lapas1!A2");"")}
as many times as you wish

Google Sheets formula to leave cell empty based on conditions

I'm having issues with this formula:
=ARRAYFORMULA("WORD"&" "&sheet1!$B$20&" "&'sheet2'!A2:A&" "&sheet1!$B$17&'sheet2'!B2:B)
What I want is to leave empty cell if there is no data available in sheet 2 and when the data is added in the sheet (sheet2) the formula auto populates the results in the third sheet, where the formula is placed.
Tried with If function, but I'm getting Errors.
Thanks in advance for the help.
=ARRAYFORMULA(IF('sheet2'!A2:A="","","WORD"&" "&sheet1!$B$20&" "&'sheet2'!A2:A&" "&sheet1!$B$17&'sheet2'!B2:B))

Count the Occurences of a text for the whole spreadsheet

I have a spreadsheet where in every column I have a list of names. They can repeat, and whats even worse - cells can contain some additional text (apart from the name).
What I want to do is count the occurrences of the name in the whole spreadsheet (only looking at the name, omitting the potential additional text). Is Possible?
I tried the formula =UNIQUE, but it does not work vertically (I'm working with Google Sheets)
Example of a document https://docs.google.com/spreadsheets/d/1STtJr0yisSeuv2w8_JVgQABAL5EDzI8aFmH8Vp2cOko/edit?usp=sharing
You can use Countif, Arrayformula, and Regexreplace to accomplish this task
Assuming you have the data range from A2:E12 and the prefilled unique names starting from A14
Formula:
=countif(ARRAYFORMULA(regexreplace($A$2:$E$12,".\(.*","")),A14)
Copy the formula until the last row
Hope it helps!
I'm sure that others will provide a much more elegant solution but this takes the data as presented in the spreadsheet and can be implemented in just a few minutes.
Paste this formula in Cell F3
=FILTER({A3:A13;B3:B6;C3:C5;D3:D5;E3:E5;A18:A21;B18:B20;C18:C20;D18:D20;E18:E19}, LEN({A3:A13;B3:B6;C3:C5;D3:D5;E3:E5;A18:A21;B18:B20;C18:C20;D18:D20;E18:E19}))
This creates a single column list compiled from the various smaller lists.
Highlight the range of names created in Column F (based on the test data = F3:F41), click Copy,
Highlight cell G3, click Paste special (Paste Values only) - this converts the formula to a list for entries.
Paste this formula in Cell H3 - this removes any data in brackets
=left(G3,iferror(search(" (",G3)-1,len(G3)))
Copy the formula down as many rows as there is data in Column G
Paste this formula in cell I3 - this lists the unique names
=unique(H3:H41)
Paste this formula in cell J3 and copy down as many rows as there is data in Column I - this counts the number of instances of each unique name in the master list.
=COUNTIF(H:H, I3)

Google sheet formula that finds row name and returns column headers based on marked cells

I'm trying to return the column headers for a row that is marked with an x. The row is selected from a name in the left column. I'm stuck here.
I can illustrate what I want to do by showing these images:
Start table
The result I want is this:
Outputs of the possibilities for the first sheet
I have put more information in my Example Sheet.
Link to editable example sheet
This formula should create a table (with a single formula) with the months in one column and the headers in the second column.
=ArrayFormula({A4:A15\ substitute(transpose(query(transpose(if(B4:G15="x";B3:G3&char(10);));;rows(A4:A15)));" ";)})
If you'd want to 'lookup' the months you manually type in you can wrap the above in a vlookup. Example:
=ArrayFormula(if(len(L4:L); vlookup(L4:L; {A4:A15\ substitute(transpose(query(transpose(if(B4:G15="x";B3:G3&char(10);));;rows(A4:A15)));" ";)}; 2; 0);))
You can check out both formulas in the copy of the sheet I've made in the spreadsheet you shared.

Google Spreadsheets: Formula to "interleave" or "zipper" multiple arrays

Tried searching and checking Google documentation but I am still having issues getting the results that I want for this problem.
I'm needing to split several comma-separated lists of items and recombine them so that first items in each list is combined, followed by the second item, etc.
To ask with an illustration, if I have a cell with the following
Paul, John, George, Ringo
and another cell with the following
McCartney, Lennon, Harrison, Starr
How do I use one function to produce this in a cell?
Paul McCartney, John Lennon, George Harrison, Ringo Starr
Here you go, you will need to copy to every row - but assuming your data is in columns A and B it will work across a dynamic number of items:
=ARRAYFORMULA(join(",",split(A1,",")&" "&split(B1,",")))
See image example below, in row one i used the data you showed up top, and in row two i reversed the column data just to show as an example:
If you paste the first word CSV to Sheet1 and the second word CSV to Sheet2 then you could put the following into sheet3
In Cell A1:
=Sheet1!A1&" "&Sheet2!A1
This is saying take the value in sheet1 A1 and then a space " " then the value in sheet2 A1
You could also do this with the concatenate function:
=CONCATENATE(Sheet1!A1," ",Sheet2!A1)
Then just copy the formula to suit.

Resources