How to Use the CODE Function in Excel

One of the most useful functions in Excel and Google Sheets is the VLOOKUP function. This function is designed to locate a value in the first column of a table array and return a value in the same row from another specified column. It is especially handy for tasks such as retrieving product prices, accessing employee details, or correlating data across multiple sheets.

Basic Syntax

The basic syntax of the VLOOKUP function is:

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
  • lookup_value: The value you are searching for in the first column of the table array.
  • table_array: The range of cells containing the data table. This range should include both the lookup column and the result column you wish to access.
  • col_index_num: The number of the column in the table_array from which to fetch the value. Numbering starts at 1 for the first column, 2 for the second, and so on.
  • range_lookup: Optional. Set to TRUE or leave blank for an approximate match. Set to FALSE for an exact match.

Example: Price Lookup

Consider you have a table where column A contains product names and column B contains their respective prices. You want to determine the price of a product called “Apple”.

Product Price
Apple 0.99
Orange 1.25

To find the price of “Apple”, you would use the following formula:

=VLOOKUP("Apple", A2:B3, 2, FALSE)

This will return the price 0.99.

Example: Employee Information

Suppose you have a table with employee IDs in column A and names in column B. You need to find the name of the employee with ID 123.

Employee ID Name
123 John Doe
456 Jane Smith

To locate the name of the employee with ID 123, use this formula:

=VLOOKUP(123, A2:B3, 2, FALSE)

This formula returns the name John Doe.

Mastering the VLOOKUP function can greatly enhance your ability to manage and analyze data in Excel and Google Sheets.

More information: https://support.microsoft.com/en-us/office/code-function-c32b692b-2ed0-4a04-bdd9-75640144b928

Other functions
Returns an array of text values from any specified range
Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters
Converts a number to text, using the ß (baht) currency format
Returns the character specified by the code number
Removes all nonprintable characters from text
Combines the text from multiple ranges and/or strings, but it doesn't provide the delimiter or IgnoreEmpty arguments
Joins several text items into one text item
Changes half-width (single-byte) English letters or katakana within a character string to full-width (double-byte) characters
Converts a number to text, using the $ (dollar) currency format
Checks to see if two text values are identical
Finds one text value within another (case-sensitive)
Formats a number as text with a fixed number of decimals
Changes half-width (single-byte) characters within a string to full-width (double-byte) characters
Returns the leftmost characters from a text value
Returns the number of characters in a text string
Converts text to lowercase
Returns a specific number of characters from a text string starting at the position you specify
Converts text to number in a locale-independent manner
Extracts the phonetic (furigana) characters from a text string
Capitalizes the first letter in each word of a text value
Replaces characters within text
Repeats text a given number of times
Returns the rightmost characters from a text value
Finds one text value within another (not case-sensitive)
Substitutes new text for old text in a text string
Converts its arguments to text
Formats a number and converts it to text
Combines the text from multiple ranges and/or strings, and includes a delimiter you specify between each text value that will be combined If the delimiter is an empty text string, this function will effectively concatenate the ranges
Removes spaces from text
Returns the Unicode character that is references by the given numeric value
Returns the number (code point) that corresponds to the first character of the text
Converts text to uppercase
Converts a text argument to a number
Returns text from any specified value