How to Fill Missing Vendor Names in Excel Using INDEX and MATCH
Question details
The user needs a formula to fill blank cells in a vendor name column by matching document numbers from another column to retrieve the correct vendor name.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Consolidating and cleaning spreadsheet data where some rows are missing vendor names but share a common document number with fully populated rows.
- Observed behavior
- The vendor names column contains blank cells that need to be populated dynamically using non-blank values from other rows associated with the same document number.
Ensure your document numbers are formatted consistently as either text or numbers, and remove any trailing spaces using the TRIM function to prevent match errors.
Use INDEX and MATCH with Exact Match Parameter
Create a helper column using an INDEX and MATCH formula with an exact-match argument (0) to pull the correct vendor names, then paste the results over the original blanks.
The INDEX and MATCH combination is ideal for this scenario. By setting the MATCH function's final argument to 0, you force Excel to find an exact match for your document number, ensuring accuracy even if the data is unsorted.
Click on the column header next to your data, such as Column Z (or any empty column), to use it as a temporary workspace for your formulas.
Select the second cell of your helper column (e.g., Z2) and type the formula: =INDEX($Y:$Y,MATCH(D2,$D:$D,0)). Press Enter to confirm.
Select cell Z2, hover over the small square at the bottom-right corner until your cursor becomes a crosshair, and double-click or drag it down to apply the formula to all rows.
Highlight all the newly calculated cells in Column Z, press Ctrl+C to copy, then right-click on cell Y2 (the top of your original vendor column). Choose 'Paste as Values' (the clipboard icon with 123) to permanently replace the formulas with the actual text.

Easily Organize and Clean Data with WPS Spreadsheet
WPS Spreadsheet handles complex formulas like INDEX and MATCH flawlessly, allowing you to clean your datasets and fill in missing information in seconds. It is a highly efficient and fully compatible tool for all your data management needs.
- 1. Open your spreadsheet: Launch WPS Office, click on 'Spreadsheet', and open your document containing the incomplete vendor data.
- 2. Apply the lookup formula: In an empty column, type your INDEX and MATCH formula to dynamically look up the matching document numbers and extract the vendor names.
- 3. Paste as Values: Copy your formula results, right-click your original vendor column, and select 'Paste Special' > 'Values' to overwrite the empty cells seamlessly.

Frequently Asked Questions
Why does the MATCH formula return an #N/A error?
The #N/A error means Excel cannot find the lookup value. This happens if the document number is truly missing from the lookup column, or if there is a mismatch in data types (e.g., one is formatted as text and the other as a number). It can also be caused by hidden spaces.
What happens if all rows with the same document number have blank vendor names?
If there is no non-blank vendor name associated with that specific document number anywhere in the column, the INDEX and MATCH formula will return a 0 or a blank result. You must have at least one completed record per document number for the formula to pull the data.
Can I use XLOOKUP instead of INDEX and MATCH to fill the blanks?
Yes, if you are using a recent version of Excel or WPS Spreadsheet, you can use XLOOKUP. The equivalent formula would be =XLOOKUP(D2,$D:$D,$Y:$Y). XLOOKUP defaults to an exact match, making it slightly simpler to write than INDEX and MATCH.




