Newbie SQL
Newbie SQL

Reputation: 132

Cross refrence 2 worksheets from the same Excel file

I want to cross refrence 2 worksheets from the same Excel file using from the worksheet with the name I the column "S/T" and from the worksheet with the name "R C" the colum Ti. I want to save in I.R Co column the data values from the "Com" column from "R C" worksheet and to save in I.R t the data values from Ti column from R C worksheet. So I'm thinking about applying inner join using Excel. So I used the VLOOKUP but it doesn't work for me. Not sure why.

The excel worksheet table I: enter image description here

And here the excel worksheet table RC: enter image description here

Here the link for the Excel file in onedrive: https://docs.google.com/spreadsheets/d/1hf9ZasTKOpJuS5MHRX3UA5tbBQfihBhTllUwa_4l2yM/edit?usp=sharing

This the SQL query to select the [Co] column:

IN SQL:

SELECT  b.[Co]
FROM I a
INNER JOIN [R C] b
ON  a.[S/T] = b.[Ti]

This the SQL query to select the [Ti] column:

IN SQL:

SELECT b.[Ti]
FROM I a
INNER JOIN [R C] b
ON  a.[S/T] = b.[Ti]

Can you please help me guys? Thanks in advance for the help..

Upvotes: 0

Views: 91

Answers (2)

Newbie SQL
Newbie SQL

Reputation: 132

Here the solution to solve this problem:

=IF(ISERROR(INDEX('R C'!$A$1:$N$969, MATCH($E2, 'R C'!$G:$G,0), 6)), "", INDEX('R C'!$A$1:$N$969, MATCH($E2, 'R C'!$G:$G,0), 6))

=IF(ISERROR(INDEX('R C'!$A$1:$N$969, MATCH($E2, 'R C'!$G:$G,0), 7)), "", INDEX('R C'!$A$1:$N$969, MATCH($E2, 'R C'!$G:$G,0), 7))

Thank you @Euler's Disgraced Stepchild for the help. I really appreciate it.

Upvotes: 0

EDS
EDS

Reputation: 2195

This looks like google sheets as opposed to Excel and I'm not sure how similar those two are.

In Excel, it will work if you put something like the below in cell H2 and drag down:

=INDEX('R C'!$A$1:$N$8, MATCH($E2, 'R C'!$G$1:$G$8,0), MATCH("Com", 'R C'!$A$1:$N$1,0))

Upvotes: 2

Related Questions