VLOOKUP help

maravi

New Member
Joined
Sep 12, 2017
Messages
6
I need help with my vlookup statement. If Cell G20 is not blank, I want my formula to return the value in one of these columns...but I am having a hard time accomplishing that.

=IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,31,0),IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,34,0),IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,37,0),IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,40,0),IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,43,0),IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,46,0)))))))

Any assistance, guidance will be greatly appreciated.

Thanks
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I don't think you are ever going to get past your first test for G20<>"", if that is true it will run your very first VLookup, if not, then you are just going to get a "False" value.

I think you need to do a test on the Vlookup to see if it has the value you want, and then if not move on to the next vlookup.
 
Upvote 0
What dictates, which column should be used?
 
Upvote 0
if I take out the first two IFs, and leave =IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,37,0),IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,40,0),IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,43,0),IF(G20<>"",VLOOKUP($C$9,Data!$C:$BX,46,0)))))
I get something - which is what I want. But I do need the two statements that I am taking out.
 
Upvote 0
If you just want the value from Col T why are you doing a Vlookup to various different columns, none of which are col T?
 
Upvote 0
Also, as I look at your Vlookups more C9 will always be found in Column-C, so as Fluff is stating, why not just say something like =if(g20<>"",t##,""). where the ## is the row number you need.

You generally use the Vlookup to find a value that is not part of the data set you are looking in, though that is not always the case.
 
Upvote 0
What I meant is whatever is in T column dictates what I want returned. If the Cell in T is blank, then I shouldn't have anything...but if Cell T isn't blank, my vlookup should return a value. I may be overthinking this and might need to simplify what I am trying to accomplish, but at the moment, I am stuck on this.
 
Upvote 0
I'm not sure how you expect this to work, as you are not even looking at Col T.
Trying explaining in words (not formulae) what you are trying to do then we may be able to help.
 
Upvote 0
I don't pretend any insight into what you're actually trying to accomplish, or how anyone is to know which column of the choices on offer (31, 34, 37, 40, 43) should guide the search, but perhaps something like this?

=IF( G20 <> "", IFERROR( VLOOKUP( C9, Data!$C:$BX, MAX( T1:T5), FALSE), "No match!"), "No Lookup")

G20 determines whether or not a lookup attempt will be made;
The values in T1:T5 (I made a guess) determine which column to lookup in the data table;
"No match!" or "No lookup" show as required.

But you really need to give guidance on your thought process here.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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