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! :rolleyes:

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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
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,213,513
Messages
6,114,064
Members
448,545
Latest member
kj9

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