Professional Documents
Culture Documents
Home / Excel Tips / Why INDEX-MATCH Is Far Better Than VLOOKUP or HLOOKUP in Excel
Find Us Here
Raghu R Excel Tips
ExcelsVLOOKUPfunctionismorepopularandwidlyusedthanthe
INDEXMATCHfunction.Whenyouwanttolookupdatainaspreadsheet,
youshouldbeusingINDEXMATCHcontrarytoLOOKUPfunctions.Heres
why
Popular Posts
1.INDEXMATCHisprettyflexiblethanExcelslookupfunctions.
Advanced PivotTables:
Combining Data from Multiple
Sheets
Recent Posts
familiar,itfindsalookupvalueinatableandreturnsthecorresponding
Excel VBA: Different Types Of
valueofanothercolumn.Thisisgreatforlookingupinformationby Excel Macros
reference.Intheexampleimageabove,Nameisthelookupvalue,andit
returnsthematchingSalary.IfyouareapowerExceluser,youarelikely Excel VBA Tip: Remove Blank
Lines From A Text File with
veryfamiliarwiththisfunction.Ifnot,hereshowitworks: Condition
Games
VLOOKUP,thoughpowerfulanduseful,isnotwithoutitslimitations.In
fact,itcanbedangerousbecauseofsomeunexpectedeffectsandbehaviors. Interview Tips
IfyouuseVLOOKUP,pleasereadontolearnabouttheseissues.This
Learn Excel
equallyappliestoVLOOKUPssisterfunctionHLOOKUP(whichdoes
horizontallookupsinsteadofverticallookups)andanothersimilarfunction, VBA Tips
LOOKUP.Ihaveprovidedasaferandmoreflexiblealternativelookup
method,whichIusevirtuallyeverywhereinplaceofVLOOKUP.
First,IllexplainsomeofVLOOKUPslimitations:
1.Yourdatarangeislimitedtoatable.Thatmeansthedatayouare
lookinguphastobeinastandardtabularform.Youcannotuse
VLOOKUPtofindalookupvalueinadifferenttable,sheet,oroffset
row.Thislimitsthewaysyoucandisplayyourdata,asanythingyou
wanttolookupmustbeavailableinastandardtableformatinyour
spreadsheet.
2.VLOOKUPalwayssearchestheleftmostcolumnofthespecifiedtable
tofindthelookupvalue.Again,thislimitsyourchoicesinpresenting
dataaslookupvaluesalwayshavetobetotheleftofthereturnvalues.
Thissometimesmeansyoumusthavemultiplecopiesoftablesin
order,thinkfaraheadwhencreatingtablesthatmightbeusedin
lookup,orreordercolumnsafterthefactsimplytouseVLOOKUP.
3.Youcanonlyspecifythereturnvaluecolumnbyindexnumber.This
meansthereisnowaytoincludeastaticreferencetothereturnvalue
column.Ifsomeoneaddsacolumnbetweenthelookupvaluecolumn
andreturnvaluecolumn,itwillbreakyourVLOOKUPandyouhaveto
manuallyincreasethecolumnindexnumberintheformulas.Thisisa
maintenancenightmare.
4.VLOOKUPprovidesaverylimitedapproximatematchfeature.The
onlyaproximatematchoptionfindsthenearestlessthanvalue.
Unlessyouwantthattypeofbehavior,youreoutofluckandcantuse
it.
Now,herearesomedangersofVLOOKUP:
1.Bydefault,VLOOKUPusesapproximatematch.Ifthisishowyou
wantittofunction,thengreatHowever,inmanycasesyouwantan
exactvaluereturned.Itgivesnoindicationitispickingaclosestmatch
result.Ifyoudonotwantthisbehavior(whichismostofthetime,I
havefound),youremembertoexplicitlysettheRange_lookup
argumentintheformulatoFALSE.Range_lookupisoptional,andnot
averydescrivenameofthisfeature,soitisoftenoverlooked.This
quirkisexasperatedbytheseconddanger
2.VLOOKUPcanprovidefalseresultsifthetableisnotsortedin
ascendingorder!Thisisanissuewhenyouusetheapproximate
matchfeature,whichisTRUEbydefault.Basically,VLOOKUPstarts
atthetopofthetableandgoesdownrowbyrowuntiltogetstoavalie
lessthanorequaltothelookupvalue.Ifyourtableisnotsortedin
ascendingorder,thiscangivefalseresults,astheformulastops
processingrowsimmediatelyafterfindingamatch.
Sufficientlyscared?Checkingyourspreadsheetsforissuesnow??The
answertotheseproblemsandlimitationsistheINDEXMATCHlookup
method.Thismethodsusestwofunctionstogethertoprovideamoresafe
andflexiblelookupfeature.Hereshoweachfunctionworks,independently:
INDEXreturnsthevalueattheintersectionofarowandcolumnina
givenrange.
Formula:=INDEX(Array,Row_num,Column_num)
ArrayTherangeofcells
Row_numTherowtoreturndatafrom
Column_numThecolumntoreturnthedatafrom
[optional]
MATCHreturnsapositionofaniteminanarraythatmatchesavalue.
Formula:=MATCH(Lookup_value,Lookup_array,
Match_type)
Lookup_valueThevalueyouwanttofindinthe
lookupvaluearray
Lookup_arrayTherangecontaininglookupvalues
Match_typeExact(0),NearestLessThan(1),or
NearestGreaterThan(1)[optional]
Combiningthetwofunctions,youareabletoeffectivelybeatthelimitations
anddangersofVLOOKUP.Youcanbuildalookupthatallowsyoutospecify
thelookupcolumnandreturnvaluecolumncompletelyindependently,and
alsocontrolofthenatureoftheapproximatematch,ifnotexact.Thearrays
arerangesandyoucanspecificColumn_numinplaceofRow_num,which
meanyouarenotlimitedtousingcolumnsonlythiscanbeusedinplaceof
HLOOKUP.Itstillhastheapproximatematchfeatureasnearestlessthan
bydefault,andcarriesthesamesortwarningsasVLOOKUP.Hereshow
thecombinedfunctionworks:
=INDEX(Return_value_range,MATCH(Lookup_value,
Lookup_value_range,Match_type))
Return_value_rangeTherangethatholdsthereturn
values
Lookup_valueThevalueyouwanttofindinthelookup
valuearray
Lookup_value_rangeTherangecontaininglookupvalues
Match_typeExact(0),NearestGreaterThan(1),orNearest
LessThan(1)
Enjoy,anduseingoodhealth!
ExampleofaINDEXMATCHformulaexposedinanExcel
SpreadsheetVlookup_Index_Match.xls
Courtesy:thinketg.com
Share this:
Related
Raghu R
ExcelismyPassionandVBALoveofLife.Iliketosolveand
automateanypossibleopportunityinExcelincludingincombination
withOfficeApplications(Access,Outlook,Word,PowerPoint,Visio,
etc)andotherNonOfficeApplications(SAP,IE,Batch,
ConfigurationManagementTools,etc).Note:Allthesolutionsgiven
herearepublishedafterthoroughlytestedtomyknowledge,however
itisadvisedtokeepacopybeforeyoutryit.
2 Responses
Showallresponses
Home / Excel Tips / Advanced PivotTables: Combining Data from Multiple Sheets
Find Us Here
Raghu R Excel Tips Learn Excel
Share Tweet 9 9
WhenyouwanttocreateaPivotTable,whatdoyoudoifyouhavedatain
differentworksheets?IfyoureusingExcel2013,youhaveastreamlined
methodofdoingthis.TheresatechniquecalledtheDataModel,andituses
datarelationshipsthewayadatabasedoes.
Popular Posts
Inthistutorial,IllshowyoueverythingyouneedtomakeaPivotTablein
Excel2013fromdatainmultiplesheets,usingtheDataModel.
How to Unprotect an Excel Sheet
Without Password
Examining the Data
Learn to use Vlookup in Excel
Thisworkbookhasthreeworksheets:CustomerInfo,OrderInfo,and
PaymentInfo.
Learn to Compose and send
emails from Excel using VBA
ClicktheCustomerInfosheet,andseethatitcontainsordernumbersand
thenameandstateofcustomers. 10 Top Excel Keyboard Shortcuts
Advanced PivotTables:
Combining Data from Multiple
Sheets
Recent Posts
wellasfieldsforthemonth,theproductsordered,andwhetherornotthe
Excel VBA: Different Types Of
productsareorganic. Excel Macros