vlookup only on data which passes another test

hiz

New Member
Joined
Mar 10, 2011
Messages
2
Hi,
im new here ad would like some help please! :help:

Im trying to perform a vlookup but only searching through rows which have a matching text string.

Column A - list of text "Yes" or "No"
Column B - list of server IP addresses
Column C - server name

Id like to do a vlookup (or similar) from another sheet so that it matches the server IP address, returns the name BUT ONLY for the rows where column A is "Yes".

I've got the standard vlookup running OK but its not doing the Yes/No check.

Any advice welcomed as I've confused myself looking at nested vookups, match statements and so on!

Thanks!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi, welcome to the board.

Do you mean like this ?

Code:
=if(A1="YES",vlookup(....),"something else")

Replace .... with your vlookup formula.
Replace "something else" with whatever you want to do if A1 is not = "YES"
 
Upvote 0
Or is this do you mean?

Confirmed with Control+Shift+Enter, not just Enter.

=INDEX(ServerName,MATCH(1,IF(ListofText="Yes",IF(IPIddress=A1,1)),0))
 
Upvote 0
Hi, welcome to the board.

Do you mean like this ?

Code:
=if(A1="YES",vlookup(....),"something else")

Replace .... with your vlookup formula.
Replace "something else" with whatever you want to do if A1 is not = "YES"

Hi, no i dont think thats what I need.

I only need the vlookup to return a value from C, if it finds a match in B. But only if A contains "yes".

One way I guess it to automatically limit the array range to only the rows which has column A containing "yes". Essentially ignoring the rows of data where the value in A is "no".

Does this make more sense?
 
Upvote 0
Does this make more sense?

Not to me, sorry.

I think it would help if you could give us a small sample of your data (or make up some sample data if you don't want to show real data) together with what exactly you want to do.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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