Vlookup or Match by split function - indexing

I am working on a project in google sheets and I have tried to use INDEX, MATCH, SPLIT function to get the result in column B. It doesn't seems to work at all.
I have provided a screenshot below.
Match & Split
Column B is where it need to return the value from column D (Date) by matching in Column F (Desc.)
by separating the value of Column F by ","
The end result is shown below.
Match & Split1
If anyone can help would be highly appreciated.

Try below formula:
=QUERY($D$3:$F,"Select D where F like '%"&A3&"%'")

Related

Using Google Sheets query function and it is not returning the correct rows

I am using the google sheets query function to dynamically pull data from another sheet into an easier to read sheet. This is me attempting to make google sheets into a functional database. An example table of the data is shown below.
Example Table of the Raw Data
The query I am writing is
=QUERY(Raw_Data!A1:E10000, "select B where D = '"&D3&"' and C = '"&D2&"'",0)
which returns no results when
D3 is equal to "Saturday, February 5" and
D2 is equal to "Wairakei 2".
However, when replacing the "and" with an "or" and leaving the cells the same
=QUERY(Raw_Data!A1:E10000, "select B where D = '"&D3&"' and C = '"&D2&"'",0)
this returns
152646563
153237668
145802639
It seems like this should be the result I get with the "and" operator and is wrong for the "or" operator. Any help on this issue would be gladly appreciated. Thanks in advance for your help.
If D3 is a date, use
D = DATE'"&TEXT(D3,"yyyy-MM-dd")&"'
instead of D = '"&D3&"'

is there a way to give column names to pd.read_clipboard() as it is treating first row of data as column names

I am using pd.read_clipboard() function to get an excel table that doesnt have column names as first row . The dataframe returned has first row as column labels. How to fix that.
I would like results to be
and not this
Though not showing up on help for read_clipboard() function , passing read_clipboard(names=['c1','c2']) where c1 and c2 are the column names fixes the read_clipboard() function to not treat first row as column names i.e provide column names to avoid having the function treat first row as column names

Google spreadsheet "=QUERY" join() equivalent function?

This question is concerning joining two databases in Google spreadsheet using =QUERY function
I have a table like so in range A1:C3
a d g
b e h
c f i
I have another table
c j m
a k n
b l o
I want the final table to look like this
a d g k n
b e h l o
c f i j m
I can do this by using a vlookup function pretty easily in cell D1 and paste it down and across, but my dataset is huge. I would need a whole page of vlookups and Google Spreadsheet tells I'm at my limit in complexities.
I look at the Google's Query Language reference... there doesn't seem to be an type of "join" functions mentioned. You would think it would be an easy "join on A" type operation.
Can anybody solves this without a vlookup?
Short answer
Google QUERY Language version 0.7 (2016) doesn't include a JOIN (LEFT JOIN) operator but this could be achieved by using an array formula which result could be used as input for the QUERY function or for other uses.
Explanation
Array formulas and the array handling features of Google Sheets make possible to make a JOIN between two simple tables. In order to make easier to read, the proposed formula use named ranges instead of range references.
Named Ranges
table1 : Sheet1!A1:C3
table2 : Sheet2!A1:C3
ID : Sheet1!A1:A3
Formula
=ArrayFormula(
{
table1,
vlookup(ID,table2,COLUMN(Indirect("R1C2:R1C"&COLUMNS(table2),0)),0)
}
)
Remarks:
Using open ended ranges is possible but this could make the spreadsheet slower.
To speed up the recalculation time :
Replace Indirect("R1C2:R1C"&COLUMNS(table2),0) by an array of constants from 2 to number of columns of table2.
Remove the empty rows from the spreadsheet
Example
See this sheet for an example
Note
On 2017 Google improved the official help article in English about QUERY, QUERY function. It still doesn't include yet topics like this but could be helpful to understand how it works.
So, this answers how you do it WITH a Vlookup-function, but in only one cell.
In your example, given that each table of data has the following cell references:
Table1: Sheet1!A1:C3
a d g
b e h
c f i
Table2: Sheet2!A1:C3
c j m
a k n
b l o
This is how the formula should be constructed.
Join-formula
=ArrayFormula(
{
Sheet1!A1:C,
vlookup(Sheet1!A1:A, {Sheet2!A1:A, Sheet2!B1:C}, {2,3}, false)
}
)
The key to get this formula to work, is to understand how to use curly brackets in the Vlookup Range. You basically define the first cell reference of the Range as the column which is to be a match to the Vlookup Search_Key. The rest of the cell references in the Range is in relation to the columns which you would like to join.
The Index is written as {2,3} to return the second and third column of the Range (the Range consists of a total of 3 columns); curly brackets has nothing to do with Arrayformula in the Vlookup Index, but is necessary to return multiple columns from the Vlookup function. The reason to not write {1,2,3} is because you would not like to include the column which is being used for the purpose of joining.
Example where the column in table2 used for joining, is located in a different column (to the right of the data which is to be joined)
This kind of Join-formula can be utilized even if the join-column in the second table is located as the third column of that table.
Let's say that the raw-data in this example would look like this:
Table1 (Sheet1):
a d g
b e h
c f i
Table2 (Sheet2):
j m c
k n a
l o b
If you write the formula like this, you'll still get the desired outcome (as displayed in the table of joined data):
=ArrayFormula(
{
Sheet1!A1:C,
vlookup(Sheet1!A1:A, {Sheet2!C1:C, Sheet2!A1:B}, {2,3}, false)
}
)
The table of joined data:
a d g k n
b e h l o
c f i j m
In the Join-formula, notice that the third column of Table2 is located as the first cell reference in the Vlookup Range!
The reason to why this works, is because when you use curly brackets in the Range (in conjunction with Arrayformula), the Vlookup Search_Key will NOT look for a column as a common denominator within the raw-data, instead it will use the Array within curly brackets as a reference to find a column as a common denominator (by default this is the first column of the Range).
I've written a comprehensive guide about this topic called:
'Mastering Join-formulas in Google Sheets'
You can use ARRAYFORMULA or YOU can just drag this formula:
after an import or QUERY-ing the first table; in the D column:
=QUERY(Sheet2!A1:C3, "Select B,C WHERE A='" & A1 & "'", 0)
I solved this by using Javascript LINQ (language integrated query).
It lets you specify Javascript with complex join conditions. You can also perform other SQL queries such as Grouping, Projecting, Sorting and Filtering your sheets as if they were database tables. Look at the links below.
Note that in the LINQ query language I replaced all spaces in column names with underscores to make them valid JS identifiers.
https://docs.google.com/spreadsheets/d/1DHtQlQUlo-X_YVfo-Wo-b7315sSk2pxL5ci4Y9lxvZo/edit?usp=sharing
https://script.google.com/d/1R5L2ReHJrBRwyoSoVOFLzEQZiGtxidPfPkAeVownt7SWX6TpacY7gA7j/edit?usp=sharing
If you can map each "index" (a, b, c) to a specific row or column, then you could use the INDEX function.
In this case, you could probably map 'a' to column A (or row 1), 'b' to column B (or row 2), and so on.
Also, Merge Tables seem to address this exact use case.
With the 'other' table in A5:C7, please try:
=query({A1:C3,query(sort(A5:C7,1,TRUE),"Select Col2,Col3")})

QUERY and IF function

I have a long, long query function into a if function from three cells (below is a simple version with two cells):
=IF(B2="All";Query(Sheet!1:100000;"select B,C,F"); Query(Sheet!1:100000;"select B,C,F where C contains """&B2&""" and B contains """&D2&""" ")
B2 and D2 are the cells where I have item lists that fill my query
Now I want: insert a blank value at the start of the query. I can use:
if (isblank(B2);iferror(1/0)
but doesn't go with two or more cells.
=if (isblank(B2);iferror(1/0), if(isblank(D2);iferror(1/0),,IF(B2="All";Query(Sheet1!1:100000;"select B,C,F"); Query(Sheet1!1:100000;"select B,C,F, where C contains """&B2&""" and B contains """&D2&""" "))))
More, I want learn to use different conditions (with OR and AND).
Can you help me?
I don't know what you want either but guess it might be:
=IF(or(ISBLANK(B2),isblank(D2)),iferror(1/0),if(B2="All",Query(Sheet4!1:100000,"select B,C,F"), Query(Sheet4!1:100000,"select B,C,F where C contains """&B2&""" and B contains """&D2&""" ",C9)))

Excel 2007 - Compare 2 columns, find matching values

I have two colums. Column A and Column B which have email addresses. Column A has about 3000 rows, Column B has about 1800. Is there anyway to compare the two columns, and find any fields that match...
And if so, how to either highlight or flag them as a match... or shit, for even simplicitys sake, just give me a count of how many matches were found...
Should i try a macro? Or is there a forumula that will help with this?
You could fill the C Column with variations on the following formula:
=IF(ISERROR(MATCH(A1,$B:$B,0)),"",A1)
Then C would only contain values that were in A and C.
=VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) will solve this issue.
This will search for a value in the first column to the left and return the value in the same row from a specific column.
VLOOKUP deosnt work for String literals