Академический Документы
Профессиональный Документы
Культура Документы
Theretailerhascreatedastockcodetosavetimewhencreatinginvoices.
Thecodeismadeupofthefirsttwolettersofthewatchdescription,
alongwiththetwolastnumbersofthedateofmanufacture.
Whenprovidedwithastockcode,theVLOOKUPfunctioncanscanallof
thecodesincolumnAuntilamatchisfoundandthenreturnavalue
fromthesamerowforanyoftheothercolumns.
Inthislesson,wewillcreateaVLOOKUPthatwillautomaticallyreturn
theDescriptionofanywatch,intocolumnBwhentheuserentersastock
codeintocolumnA.
Invoice-1
140
ClickincellB6.
2.
Click:FormulasFunctionLibrary
Lookup&ReferenceVLOOKUP.
www.LearnMicrosoftExcel.com
TheVLOOKUPFunctionArgumentsdialogappears.Itcanbe
seenthattheVLOOKUPfunctionhasthreerequiredarguments
(showninboldface)andoneoptionalargument:
important
It is best practice to
use tables with your
VLOOKUP functions
InthislessonIveshownyou
howtoconstructaVLOOKUP
thatusesatableforthe
Table_arrayargument.
ThisisthecellontheInvoiceworksheetthatprovidesthevalueto
besearchedforinColumnAoftheStockworksheet.Wewantto
lookupthedescriptionforthewatchthathasthecodeCA74.This
iscontainedincellA6.
ThisisbestpracticeinExcel
2007,butitwasntpossiblein
Excel2003asthe(fantastically
useful)tablefeaturewasnt
available.
Inworksheetsconstructed
usingearlierversionsofExcelit
iscommontoseeabsolute
rangereferencesforTable_array
argumentslikethis:
WhenyouseeaRangeName
referenceitlooksthesameasa
tablereference.Thisexample
showstheuseofaRangeName
alsocalledStock:
1.
ItisbestpracticetouseatablefortheTable_arrayargument
(seesidebar).
Countingfromlefttoright,theCol_index_numargumentisthe
columnthatcontainsthevaluewewanttoreturn.Inthiscase,itis
theDescriptioncolumn,sowewanttoreturncolumn2.
Usersofearlierversionshadto
resorttoacomplexwork
aroundtomaketheirRange
Namesdynamic.Youlllearn
aboutthisworkaroundin:
Lesson46:Createdynamic
formulabasedrangenamesusing
theOFFSETfunction.
Thisinformationisprovidedso
thatyouwillunderstandany
olderExcelworksheetsyou
mayinherit,(orworksheets
thatwerecreatedbyusersthat
haventyetlearnedhowtouse
tables)!
TypeStockintotheTable_arraytextbox.
WhileRangeNameswerebest
practiceinearlierExcel
versions,theyhaveafatalflaw
astheyarenottrulydynamic.
Moresophisticatedusersof
earlierExcelversionslearned
howtouseRangeNames.
(YoulllearnallaboutRange
Namesin:SessionFour:Using
NamesandtheFormulaAuditing
Tools).
10
2009 The Smart Method Ltd
141