Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2011, 06:38 PM
jtej009 jtej009 is offline Excel Vlookup Windows 7 64bit Excel Vlookup Office 2010 64bit
Novice
Excel Vlookup
 
Join Date: Feb 2011
Posts: 1
jtej009 is on a distinguished road
Default Excel Vlookup


How do you use vlookup to get the next best value

A B
BP
BP UK
BP UK
BP
BP UK
BP

How do you use Vlookup to get UK for BP instead of 0
Reply With Quote
  #2  
Old 02-10-2011, 03:25 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Excel Vlookup Windows 7 32bit Excel Vlookup Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Hi,

VLOOKUP() will always return the first match found so, if you search column A for "BP" then you will get "" returned.

If you want to return the first value where column A equals "BP" and column B is not empty, one formula option is:
Code:
=INDEX(B2:B7,MATCH(1,(A2:A7="BP")*(B2:B7<>""),0))
This is an array formula, so when you type it into the formula bar with CTRL+SHIFT+ENTER, not just ENTER.

If you want to return multiple results (say ALL results where column A equals "BP" and column B is not empty) then you should use the advanced filter instead of formulas.

Hope that helps...
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Vlookup & IF together thelauncher Excel 5 08-25-2013 11:32 PM
Excel Vlookup Can i do this with a VLookup? foodstudent Excel 1 01-21-2011 12:34 AM
Using IF & VLOOKUP together junction Excel 7 11-18-2010 05:15 AM
Help with VLOOKUP sakhtar Excel 2 07-24-2010 07:39 PM
Excel Vlookup VLOOKUP in Excel with grade book. Sailorcancer Excel 3 04-15-2010 09:55 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft