Questions tagged [vlookup]

VLOOKUP is a Spreadsheet function for retrieving a value from an array using a vertical lookup value and a positive column offset. Use with [excel-formula] or [google-sheets-formula] or any other product that supports such lookup

VLOOKUP is a Spreadsheet function for retrieving a value from a table array using a lookup value and a column offset.

There are four arguments to the VLOOKUP function:

  1. lookup_value - the value being searched for. This value must be located in the leftmost column of the table array in order to return a result.
  2. table_array - a range or array of values being searched for the lookup value. This argument can be a range (ex: A1:D10) or a text array (ex: {"ABC","DEF"}).
  3. col_index_num - a number setting the column of the array from which the corresponding value to be returned from the corresponding row that the lookup value is obtained from.
  4. range_lookup - TRUE or FALSE (or their numeric equivalents of 1 or 0) respectively) indicating whether the lookup is for an exact match, or closest value to the lookup value sorted in ascending order. This argument can also be a cell reference (which may contain a formula) which returns one of the above values.

It may be used on the worksheet as well as in by calling the Application.WorksheetFunction.VLookup Function or just Application.VLookup.

Related Tags:


Links:

Issues with VLOOKUP are often from one or more of the following causes:

  1. Attempting to “look to the left” – see emboldened text at 1. above. A col_index_num of 0 or less returns #VALUE! and the range for the table_array cannot be reversed within the formula (D10:A1 is treated as A1:D10). Solutions here may be to rearrange the columns (by either copying, ie a ‘helper column’, or moving the lookup_value column to the left) or to apply the INDEX/MATCH combination instead (example).

  2. Seeking a value that is not in the table_array, probably returning #N/A, or Error 2042 in VBA. Formatting (a text ‘1’ is not the same as a numeric 1) and trailing spaces, for example, may give the appearance that a lookup_value exists in the table_array when it does not. A simple way to check for this is to copy the search value onto the position in the table_array where a match is expected.

  3. Seeking a value that is outside the table_array range. This can happen when a VLOOKUP formula is copied down that refers to a stacked (columnar) range to be searched that is not an entire column and that has not been anchored (set with $s preceding row numbers) or defined as a Named Range. (example (for COUNTIFS)).

  4. Applying the wrong col_index_num, which is one-based. With a table_array, of say a column of numbers on the left and colour names immediately to the right, to return a colour name based on a lookup_value that is a number then the relevant col_index_num is 2.

  5. Failing to add 0 (or FALSE) as the fourth parameter. range_lookup is optional and defaults to TRUE (or 1) if not specified. This makes the assumption that the table_array is sorted in ascending order and applies a binary search for speed and efficiency. Where the fourth parameter for VLOOKUP is not specified and the table_array is not sorted in ascending order an incorrect result, but often plausible in appearance, is very probable.

VLOOKUP does not provide an all results of lookup in a array. If, for example, various shades of red were all assigned the same numeric code in the table_array a numeric lookup_value would, at most, find only one instance (the first, say ‘pink’). Sometimes this may be resolved to find a single result (but say ‘scarlet’ instead of ‘pink’) with a concatenated field in the table_array, and creation of a ‘key’ to suit. (example). Another case where this approach may suit is if there are several different people with the same surname - so the key might be to combine surname with a first name.

4398 questions
0
votes
1 answer

How to solve static and dynamic data alignment issues while using VLOOKUP, QUERY and ARRAYFORMULA functions on Google Spreadsheet?

I have 2 Spreadsheets S4 (Sheet 1)(Purple screen shot) **Clients that Fit Hire (Sheet 2) **(all other screen shot) (this is the sheet I need help with S4 is functioning correctly - rows are not aligning on…
0
votes
0 answers

Dynamic(ish) URL as table_array in Excel vlookup formula

I have two spreadsheets stored on SharePoint. A "training" spreadsheet that is used to manage training courses; and a "master" spreadsheet that has an overview of who is running which training. Each year we would have different subfolders and new…
Jake Lee
  • 43
  • 1
  • 1
  • 6
0
votes
1 answer

How to fix returning of the first value in a column instead of the appropriate value using VLOOKUP in Google Sheets?

Good afternoon Please give advice. In this screen, "C9" is a drop-down list of "A" values. "D9" is the result of the "VLOOKUP" function. In "E9" I need the index of the value "D9" from column "B". But the problem is that it always returns the first…
0
votes
1 answer

How to match a row with Excel column and VLOOKUP the value?

I have two sheets with two tables that look like this: Table 1: Index category 1234 Cars 5678 Trains 9101 Motorcycles 177 Motorcycles Table…
0
votes
0 answers

Is there a function to copy one sheet to another but in a different layout?

I have 70+ sheets of data. Each sheet is for just one location on a certain date. There are several time recordings for each date with values for pH, temperature etc (see 'input'). How do I get it into the form ('output') without copying and pasting…
0
votes
0 answers

Delete values in a column from another column

Is there a formula that I can use to automatically delete the values that appear in column D from column A? So that my final column A will look like this?: Thanks
tadm123
  • 8,294
  • 7
  • 28
  • 44
0
votes
1 answer

Reciprocal vlookup function- help converting from VBA to google sheets App script

I am fairly unfamiliar with both VBA and especially google sheets App Scripts. That being said I was able to google enough yesterday to figure out what I wanted to achieve in VBA. TO make sharing my spreadsheet easier i wanted to try and convert it…
0
votes
1 answer

Excel: matching range of cells against multiple comma separated lists, and returning related values

I have a large O365 Excel spreadsheet. Sheet 1 contains multiple rows with comma separated values, together with some descriptive text, in the format: | A | B ------------------------------------------ 1|…
0
votes
2 answers

Is it appropriate to use vlookup in this scenario

So I have an Excel table that looks like this: Name Category Value Joe A Joe B Joe C 4.2 Joe D 3.22 Brad A Brad B Brad C 2.25 Brad D 4.1 Ryan A Ryan B Ryan C 1.22 Ryan D …
Vuotelin
  • 47
  • 5
0
votes
2 answers

Excel Error with VLOOKUP using concatenation

I built a spreadsheet for my math class to model the "Monty Hall" probability problem (deals with conditional probability). I didn't want to dig in with VBA so I tried this with all formulas. The problem itself is modeled after the gameshow "let's…
0
votes
1 answer

Excel vlookup for 2 different cell values

so i am doing a statistic's project and i need to combine the tables with one another since the tables do not have the same countries i need to use vlookup in excel to combine it the main problem is: in the table there are countries and years which…
Perdix
  • 7
  • 5
0
votes
0 answers

to have a lookup or index in excel to get result base on quantity in excel 2016

[![enter image description here][1]][1] base on the consumption of mouse to get the order number
andren
  • 37
  • 5
0
votes
1 answer

VBA Refreshing Table After Adding Formula to Cell

I wrote some VBA code that adds a column to a table with a specific name ('test' in this case) and creates a sheet with that specific name (also 'test'). The 'test' table column then has its cells populate from the following VBA line. Sheets("Data…
Buracku
  • 37
  • 6
0
votes
2 answers

Creating a true/false column to indicate partial word matches between two columns

New to excel. I have tried using the VLOOKUP and IF function to find the best solution. However, I am struggling to get the partial match aspect down. I also want the partial match to include any spaces after the words. Example Column1 Column2 …
0
votes
1 answer

Issue with formula and before/after midnight

I am struggling with the last part of my sheet. The day shift works fine but when it comes to the night shift, it doesn't work the way I want. Some data are entered using a G-form. The shifts are 7:00:00 to 19:00:00 for Day shifts and 19:00:00 to…
Jerome
  • 57
  • 6