Vlookup does find the criteria when locatesd in several columns

sandero1970

New Member
Joined
Aug 23, 2013
Messages
19
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I have following question:

In sheet 1, I have a value in cell A1 for which I need to find a result value in Sheet 2 col G.

The complication is that my value Sheet1!A1 might be located in Sheet2 in the range C:F

A vlookup is searching value Sheet1!A1 in column C of Sheet2. So it does not work.

I've been trying with this combination but without success: =INDEX(SHEET2!G:G,EQUIV(Sheet1!A1,SHEET2!C:F,1))

Any idea how to fix this?
Thx
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
You can use nested iferrors
Excel Formula:
=IFERROR(VLOOKUP(Sheet1!A1,C:G,5,0),IFERROR(VLOOKUP(Sheet1!A1,D:G,4,0),IFERROR(VLOOKUP(Sheet1!A1,E:G,3,0),IFERROR(VLOOKUP(Sheet1!A1,F:G,2,0)))))
 
Upvote 0
Yes indeed but it is quite a job as in fact I have 6 columns and it is a lot of IFERROR. I was thinking may be I have to create a function in VBA in the file.
Anyway thanks for your input, it is already giving me a solution.
 
Upvote 0
You don't need vba for this. One another option could be:
Excel Formula:
=INDEX(G:G,MATCH(1,(C:C=A1)+(D:D=A1)+(E:E=A1)+(F:F=A1),0))
But this is an array formula. You must press Ctrl+Shift+Enter together after paste.
Think * like AND operator and + like OR operator as in the logic.
 
Upvote 0
It is returning me an error #N/A like he dioes not see anything
here is the adapted formula:
=INDEX(Extract_HLR!G:G,MATCH(1,(Extract_HLR!$D:$D='TB1'!$B$4)+(Extract_HLR!$E:$E='TB1'!$B$4)+(Extract_HLR!$F:$F='TB1'!$B$4)+(Extract_HLR!$G:$G='TB1'!$B$4)+(Extract_HLR!$H:$H='TB1'!$B$4),0))
 
Upvote 0
(Extract_HLR!$G:$G='TB1'!$B$4)+(Extract_HLR!$H:$H='TB1'!$B$4)
Why G:G and H:H? I thought that the data you want to retrieve is already in column G? Write only the columns that you want to look up.
In INDEX function, write the only column that you want to get the data. =INDEX(Extract_HLR!G:G this looks OK.

Second thing, have you pressed Ctrl+Shift+Enter together? Click in to formula bar and pressed Ctrl+Shift+Enter together. Curly brackets must appear around your formula.
 
Upvote 0
Please find the sample file for better understanding:
 
Upvote 0
Why G:G and H:H? I thought that the data you want to retrieve is already in column G? Write only the columns that you want to look up.
In INDEX function, write the only column that you want to get the data. =INDEX(Extract_HLR!G:G this looks OK.

Second thing, have you pressed Ctrl+Shift+Enter together? Click in to formula bar and pressed Ctrl+Shift+Enter together. Curly brackets must appear around your formula.
My misatke, it was an example, the data I need to have is column J so I changed but the error is still there and yes I kept ctrl shift enter
 
Upvote 0
I guess it is a proble of data type as my data is like '0502501 but it is in general format in all sheets of the file
 
Upvote 0
Sorry, I don't believe I can help further. Maybe you must wait for another help.
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,543
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top