How to Match DSCODEs to Company Names in Excel
Question details
The user wants to find and retrieve company names corresponding to specific DSCODEs within a spreadsheet.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Matching data from a list of codes to their respective entity names using lookup functions.
- Observed behavior
- The user has a list of DSCODEs but needs to automatically populate the corresponding company names by referencing a master database or table.
Ensure you have a reliable reference table within your workbook that accurately maps every DSCODE to its corresponding company name, and verify that there are no trailing spaces in your code cells.
Use VLOOKUP to Match DSCODEs to Company Names
VLOOKUP is the standard method for searching for a code in a reference table and returning the adjacent company name.
The VLOOKUP function searches for a specific value in the first column of a table array and returns a value in the same row from another column. For this to work, your reference table must have the DSCODEs situated in the leftmost column.
Ensure your reference database has the DSCODE in the first column and the Company Name in the second column.
Click the empty cell next to the DSCODE in your main dataset where you want the matched company name to appear.
Type =VLOOKUP(A2, Sheet2!$A$2:$B$100, 2, FALSE). In this formula, A2 is the DSCODE you are looking up, Sheet2!$A$2:$B$100 is your reference table, 2 is the column index containing the company names, and FALSE ensures an exact match.
Press Enter, then click and drag the fill handle at the bottom-right corner of the cell to apply the formula down through all rows.

Use XLOOKUP for Flexible Matching
XLOOKUP is a modern, flexible alternative to VLOOKUP that allows you to look up data in any column without rearranging your reference table.
Easily Match Data and Use Lookup Functions with WPS Office
WPS Spreadsheet provides robust support for all advanced lookup functions, including VLOOKUP, XLOOKUP, and INDEX/MATCH. You can easily map DSCODEs to company names with its intuitive interface, reliable formula calculation, and excellent performance.
- 1. Open your workbook in WPS Spreadsheet: Launch WPS Office and open the file containing your DSCODEs and reference table.
- 2. Access the Formula tab: Navigate to the Formulas tab on the top ribbon and select 'Insert Function'.
- 3. Select the VLOOKUP function: Search for VLOOKUP or XLOOKUP in the dialog box and click OK.
- 4. Input formula arguments: Use the visual formula builder to select your lookup value, reference array, and return column, then click OK to instantly retrieve the company name.

Frequently Asked Questions
Why is my VLOOKUP returning an #N/A error when matching DSCODEs?
An #N/A error typically means the exact DSCODE was not found in your reference table. Check for trailing spaces, formatting differences (such as numbers stored as text), or verify if the code is actually missing from the master list.
Can I match company names if my DSCODEs are in the second column of the reference table?
Standard VLOOKUP only searches the first (leftmost) column of a selected range. If your codes are situated to the right of the company names, you must use XLOOKUP or an INDEX and MATCH formula combination instead.
How do I remove the formulas and keep only the company names as text?
Select the cells containing your VLOOKUP formulas, copy them (Ctrl+C), right-click the exact same selection, and choose 'Paste as Values' (the clipboard icon with '123'). This permanently replaces the formulas with the retrieved text.




