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

awk script to match value in one of the csv column in a tab-delimited file

I have tab-delimited file and one of the column($10) is separated by commas if more than one value exists. I have a list of IDs that I want to match with the above file and find which ID is present. I need code that acknowledges the tab separation…
nivitian
  • 13
  • 4
0
votes
0 answers

Is a VLOOKUP what I need?

So I get two reports each month where I'm comparing a list of invoice numbers against a sales credit list of similar numbers. Basically I have a highly detailed report and then a simple two column report that are invoice numbers and sales credit. I…
EasyC
  • 9
  • 3
0
votes
1 answer

Google Sheets VLOOKUP and MAX to sort the end result

I made myself a task a bit more difficult than I had to but I think it is doable. =VLOOKUP( INDIRECT("A" & ROW()) ;Activations!A2:F ; 3; FALSE) This code is working for taking up ID value specified in A+ROW() in current sheet and looking for it in…
Svetoslav
  • 31
  • 2
  • 6
0
votes
1 answer

Import data from another sheet based on combobox selection

I am trying to write VBA code that will allow me to select an excel file. It will then give me a combo box that is populated with a list of rates (5Y treasury, 10Y, etc), and based on my selection import the historical rates into my active workbook.…
jmt78
  • 25
  • 4
0
votes
1 answer

How do I reference a REGEXEXTRACT result using VLOOKUP

I have imported some MLB data and I'm trying to clean it up and organize the data. I am attempting to build a very rudementary model for predicting Pitcher Strikeouts. I'm new to using formulas in google sheets and all that, just trying to educate…
0
votes
1 answer

Excel Subset Data

SHEET1 STUDENT CLASS INSTRUCTOR SCORE JOHN A 1 49 JOHN A 2 15 JOHN B 1 94 MARY A 1 23 MARY B 2 32 KATE C 3 76 KATE D 1 73 KATE D 1 56 KATE D 2 7 KATE C 7 71 JOE C 5 92 JOE…
bvowe
  • 3,004
  • 3
  • 16
  • 33
0
votes
0 answers

Excel Vlookup or Index Match questions. "duplicate values" with date range factor

I have 2 excel files. One lists all activities by a person by date for 2022. The other is a member listing showing start and end dates of a member's status. I want to search by name in the activity file to return a member status in the member…
LJA
  • 1
0
votes
1 answer

VLOOKUP with date range does not work as intended

I have two excel tables in separate sheets: table1: Site_ID ....... Visit_Date -------------------------- AS01 12-Feb-23 ES96 10-Jan-23 GH15 14-Mar-23 AS01 26-Mar-23 VD10 08-Apr-23 LS18 …
0
votes
2 answers

The Summary of the Count Number of Each Categories from Multiple Sheets

Let's say I have 11 different sheets in one Google Sheet workbook. Each of the sheets look like this: customer reason for losing PT A uncompetitive price PT B by project PT C NG quality PT D late delivery PT E term of payment PT…
0
votes
1 answer

How do i get the header value of the cell matching today?

I have following table, that i want to get the header value(T1, T2, T3...) of the cell matching today's date. These dates are formatted as DD-MM-YYYY. I tried using VLOOKUP to find the correct cell first, but that returns me a wrong date. Tried on…
Pol Santha
  • 17
  • 4
0
votes
1 answer

Google sheet formula to search table for newest scan and alternate the return value

I am building a member database for the non-profit youth center I volunteer with. I did something similar using Google sheets and Forms for a former company in managing their inventory across multiple locations. The tab that shows a date/time stamp…
0
votes
1 answer

Excel Simplify multiple lines of date ranges for matching criteria

I'm trying to use Excel to return the highest & lowest date option so I can return the true effective/expiration dates without multiple lines. Example of…
0
votes
0 answers

Vlookup a value within 7 days of a frequency date = Resolved. thanks

Resolved. thanks. thank you for all the help here
K L
  • 1
  • 1
0
votes
1 answer

create dropdown list in excel that displays different values from the same lookup table

I am trying to create a dropdown list in excel that once chosen, the text will display a different value in reference to a table on another sheet. In my example I want to have a more common site name be displayed in the dropdown, but then have the…
0
votes
0 answers

Reasons for the awk script (to implement vlookup) showing "NA" for all the matches while processing tsv files

I have two files wherein file1 spans around 6000 lns containing Id matching value and file2 1000lns containing ID. I want to retrieve value from file1 for only those IDs in file2. file1.tsv: RtGene0001 rt_000005300 RtGene0002 …
nivitian
  • 13
  • 4