{"id":471,"date":"2018-04-30T18:23:30","date_gmt":"2018-04-30T23:23:30","guid":{"rendered":"http:\/\/www.iqaccountingsolutions.com\/blog\/?p=471"},"modified":"2018-06-26T20:10:38","modified_gmt":"2018-06-27T01:10:38","slug":"automatically-look-up-data-in-excel-using-vlookup","status":"publish","type":"post","link":"https:\/\/www.iqaccountingsolutions.com\/blog\/automatically-look-up-data-in-excel-using-vlookup\/","title":{"rendered":"Automatically Look Up Data in Excel using VLOOKUP"},"content":{"rendered":"<p>A client once told me about a process that consumed several hours of their week. It involved hand entering quantities on a spreadsheet, then looking up a unit price on another spreadsheet and entering it in the next column. Naturally, they wanted a better way to complete this task. While I couldn\u2019t do anything about having to enter the quantities, I was able to save them a lot of time and reduce opportunity for errors by using Excel\u2019s VLOOKUP function to automatically bring in the correct price from their pricing spreadsheet.<\/p>\n<p>Let\u2019s look at a simple example of how this works. The spreadsheet below has sales information in columns A \u2013 D and the price list is in columns F and G.\u00a0 In a real life situation the price list would more likely be in a different workbook or at least on a different tab in the same workbook.\u00a0 But the formula still works the same way.<\/p>\n<p>You can type your <em>vlookup<\/em> formula in from scratch or use the function wizard button on the formula bar to guide you through it. Here is what each part of the formula represents:<\/p>\n<ul>\n<li><strong>VLOOKUP<\/strong> \u2013 stands for vertical lookup.\u00a0 It means Excel will search a column looking for a match of the data you specify.\u00a0 When if finds a match, it will move over to the column you choose and use whatever it finds there as the answer to your formula.<\/li>\n<li><strong>Lookup Value<\/strong> \u2013 This is what you want Excel to look for.\u00a0 You could enter text (by enclosing it in quotation marks) or a number.\u00a0 But usually this will be a reference to another cell.\u00a0 In the first example below, we are telling Excel to look for a match to whatever is in cell A2.<\/li>\n<li><strong>Table Array<\/strong> \u2013 is simply the location of the table of information Excel should look in for a match to the \u201clookup value\u201d and the information you want it to retrieve.\u00a0 It will always look for a match in the first column of the table array and pull the answer from one of the other columns.\u00a0 In our formula the table array is <em>F:G<\/em> meaning that our table is all of columns F and G.\u00a0 You could also use a specific range of cells instead of entire columns.\u00a0 For example we could have entered <em>F1:G5<\/em> to designate the area that starts in cell F1 and ends at G5. Although if not using entire columns for the table array, you&#8217;ll probably want to use an\u00a0<a href=\"https:\/\/iqaccountingsolutions.us2.list-manage.com\/track\/click?u=0b92990bba1267be26b8ca6db&amp;id=6eb4754740&amp;e=b0476d6293\"> absolute reference<\/a>, as in <em>$F$1:$G$5,<\/em> so that it won&#8217;t change when you copy the formula to other cells.<\/li>\n<li><strong>Column Index Number<\/strong> \u2013 tells Excel which column within the table array to look in for the answer to your formula.\u00a0 Since we want the unit price from column G, and G is the second column in the table array, our column index number is <em>2<\/em>.<\/li>\n<li><strong>Range Lookup<\/strong> \u2013 You will enter <em>False<\/em> in this example. Entering <em>\u201cFalse<\/em>\u201d tells Excel to only return an answer if an exact match is found.\u00a0 Entering \u201c<em>True<\/em>\u201d or omitting the range lookup will return an answer for the closest match if an exact match isn\u2019t found.<\/li>\n<\/ul>\n<p>Once you have entered the formula on the first line, you can copy it down the rest of the column.\u00a0 So entering the formulas shown in column C here:<\/p>\n<p>&nbsp;<\/p>\n<table border=\"1\" width=\"656\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"24\"><\/td>\n<td width=\"24\">\n<p align=\"center\">A<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">B<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">C<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">D<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">E<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">F<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">G<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">1<\/p>\n<\/td>\n<td width=\"97\">ITEM<\/td>\n<td width=\"56\">QTY<\/td>\n<td width=\"179\">PRICE<\/td>\n<td width=\"113\">EXT AMOUNT<\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">ITEM<\/td>\n<td width=\"49\">UNIT PRICE<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">2<\/p>\n<\/td>\n<td width=\"97\">Gadget B<\/td>\n<td width=\"56\">2<\/td>\n<td width=\"179\">=VLOOKUP(A2,F:G,2,FALSE)<\/td>\n<td width=\"113\"><\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">Gadget A<\/td>\n<td width=\"49\">10<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">3<\/p>\n<\/td>\n<td width=\"97\">WIDGET 2<\/td>\n<td width=\"56\">1<\/td>\n<td width=\"179\">=VLOOKUP(A3,F:G,2,FALSE)<\/td>\n<td width=\"113\"><\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">Gadget B<\/td>\n<td width=\"49\">12<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">4<\/p>\n<\/td>\n<td width=\"97\">WIDGET 1<\/td>\n<td width=\"56\">4<\/td>\n<td width=\"179\">=VLOOKUP(A4,F:G,2,FALSE)<\/td>\n<td width=\"113\"><\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">WIDGET 1<\/td>\n<td width=\"49\">21<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">5<\/p>\n<\/td>\n<td width=\"97\">Gadget A<\/td>\n<td width=\"56\">5<\/td>\n<td width=\"179\">=VLOOKUP(A5,F:G,2,FALSE)<\/td>\n<td width=\"113\"><\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">WIDGET 2<\/td>\n<td width=\"49\">25<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Will find the correct unit price for each item, as shown here:<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"24\"><\/td>\n<td width=\"24\">\n<p align=\"center\">A<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">B<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">C<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">D<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">E<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">F<\/p>\n<\/td>\n<td width=\"24\">\n<p align=\"center\">G<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">1<\/p>\n<\/td>\n<td width=\"97\">ITEM<\/td>\n<td width=\"56\">QTY<\/td>\n<td width=\"179\">PRICE<\/td>\n<td width=\"113\">EXT AMOUNT<\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">ITEM<\/td>\n<td width=\"49\">UNIT PRICE<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">2<\/p>\n<\/td>\n<td width=\"97\">Gadget B<\/td>\n<td width=\"56\">2<\/td>\n<td width=\"179\">12<\/td>\n<td width=\"113\">24<\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">Gadget A<\/td>\n<td width=\"49\">10<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">3<\/p>\n<\/td>\n<td width=\"97\">WIDGET 2<\/td>\n<td width=\"56\">1<\/td>\n<td width=\"179\">25<\/td>\n<td width=\"113\">25<\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">Gadget B<\/td>\n<td width=\"49\">12<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">4<\/p>\n<\/td>\n<td width=\"97\">WIDGET 1<\/td>\n<td width=\"56\">4<\/td>\n<td width=\"179\">21<\/td>\n<td width=\"113\">84<\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">WIDGET 1<\/td>\n<td width=\"49\">21<\/td>\n<\/tr>\n<tr>\n<td width=\"24\">\n<p align=\"center\">5<\/p>\n<\/td>\n<td width=\"97\">Gadget A<\/td>\n<td width=\"56\">5<\/td>\n<td width=\"179\">10<\/td>\n<td width=\"113\">50<\/td>\n<td width=\"36\"><\/td>\n<td width=\"85\">WIDGET 2<\/td>\n<td width=\"49\">25<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"line-height: 110%;\"><span style=\"font-size: 10.5pt; line-height: 110%; font-family: 'Arial','sans-serif'; color: #082042;\">VLOOKUP is a great way to combine two sets of data into one. Once you are comfortable with it, you will find many ways to make use of it.<\/span><\/p>\n<p>By the way, in case you&#8217;re wondering, there&#8217;s also an HLOOKUP function that works similarly for horizontal look-ups.<\/p>\n<p><iframe loading=\"lazy\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/9gGY0rF8n_Y?feature=oembed\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tired of looking up information on one spreadsheet just to manually enter it on another?  You need to learn about VLOOKUP.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/471"}],"collection":[{"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=471"}],"version-history":[{"count":8,"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/471\/revisions"}],"predecessor-version":[{"id":1146,"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/471\/revisions\/1146"}],"wp:attachment":[{"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iqaccountingsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}