In the Col_index_num field, specify the column number that contains the answer.
Usually, you want to select the entire table. In the Table_array field, select the section of the table where the search will be performed. In the Lookup_value field, specify the cell that contains the reference of the item you want to find the answer to-for example, C9. Under the "Functions Library" section, click the Lookup and Reference drop-down menu and select the VLOOKUP option to open the Functions Arguments wizard.
For example, if you want to see the price for the "20oz" bottle of Kiwi juice, then replace "Orange" with "Kiwi" in the "lookup_value" cell and press Enter to update the result. If you are trying to find data for another item, update the name of the cell on step No. If you receive the "#NAME?" error value, then it means that the formula is missing one or multiple quotes. Once you complete the steps, the feature will return the value for the item you specified on step No. Here's an example that returns the price for the 20oz bottle of orange juice: You do not need a space between each comma. Also, remember to use a comma to separate each value in the function. In the command, make sure to update the variables inside the parenthesis with the information you want to query. If you're not getting the correct value, you should use the "false" option or sort the first column alphabetically or numerically. Sometimes, when using the "true" option, the first column needs to be shorted, which may cause an unexpected result. Quick note: If you don't specify a value, then the "true" option will be applied by default. Usually, you want to use the false option. Range_lookkup: includes two options: "false" for exact match or "true" for an approximate match. When specifying multiple columns, you should do from left to right. col_index_num: defines the column number that the function will look to find a value.Typically, you would select the entire Excel table. table_array: defines the range of data where you want to perform a search.lookup_value: defines the cell that includes the product identifier from the first column on the left.=VLOOKUP(lookup_value,table_array,col_index_num,range_lookkup) Type the following arguments inside the parenthesis "()" to write the function and press Enter: In the empty cell, type the following syntax to create a VLOOKUP formula and press Enter:
Step 4: Click Developer->Macros to run Macro.In this Windows 10 guide, we'll walk you through the steps to correctly write a basic VLOOKUP function with the desktop version of Microsoft Excel, whether you use the version of Office available through a Microsoft 365 subscription, Office 2019, Office 2016, or earlier version. Step 3: Save code, quit Microsoft Visual Basic for Applications. MsgBox "the sales number of " & lookupValue & " is " & result Result = (lookupValue, myrange, 2, False) Step 2: In Microsoft Visual Basic for Applications window, enter below code: Sub vlookupExample() You can also press Alt + F11 keys simultaneously to open it. Or you can enter Microsoft Visual Basic for Applications window via Developer->Visual Basic.
Select View Code, Microsoft Visual Basic for Applications window pops up.
Step 1: On current visible worksheet, right click on sheet name tab to load Sheet management menu. To lookup for the value “word”, and you just need to follow the below steps: And suppose you want to retrieve the number of sales for product “word” in Cell E2 appears in the second column of the table array argument A2:C6. The below will show you one examples of the VLOOKUP function in Excel VBA Macro.