How to Automatically Return Excel Data by Store Number
Question details
The user wants to automatically retrieve and display location details on one worksheet when entering a specific store number, using source data from another worksheet.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Retrieving corresponding data across different worksheets based on a unique identifier, such as a store number.
- Observed behavior
- The user needs an automated formula setup to dynamically fetch matching location details without having to manually search and enter the data.
Ensure that your source data is organized as a table or a structured range, with the store numbers located in the very first column of that range if you plan to use VLOOKUP.
Use the VLOOKUP Function
Use the classic VLOOKUP formula combined with the COLUMN() function to automatically pull multiple columns of data at once.
VLOOKUP is a built-in Excel function designed to search for a specific value in the first column of a data range and return a value in the same row from another column.
Click on the first cell where you want the returned location details to appear (for example, B2).
Type the formula =VLOOKUP($A2,Sheet2!$A$2:$G$100,COLUMN(),FALSE). Make sure to replace 'Sheet2!$A$2:$G$100' with the actual range containing your source data on the other worksheet.
Press Enter to apply the formula. Click the fill handle at the bottom-right corner of the cell, then drag it across the columns and down the rows to populate the remaining location details.
Fix #N/A Errors in Lookup Formulas
Resolve common formatting and range issues that prevent Excel from finding a matching store number.
Use the XLOOKUP Function (Microsoft 365)
If you are using Microsoft 365, XLOOKUP provides a more flexible way to return data without requiring the store number to be in the first column.
Easily Manage Data Lookups with WPS Office
WPS Spreadsheet fully supports advanced lookup functions like VLOOKUP and XLOOKUP, making it incredibly easy to automate and pull store data across multiple worksheets.
- 1. Open Your Data: Launch WPS Spreadsheet and open the workbook containing your store numbers and source data.
- 2. Insert the Function: Navigate to the 'Formulas' tab and click on 'Insert Function'. Search for 'VLOOKUP' or 'XLOOKUP' and select it.
- 3. Input Arguments: Follow the simple dialog box prompts to define your lookup value, table array, and column index, then click OK to fetch your data.

Frequently Asked Questions
Why is my VLOOKUP returning a #N/A error even though the store number exists?
This usually happens because the store number formats do not match between the two worksheets. One might be stored as text while the other is a number. To fix this, select both columns, right-click, choose 'Format Cells', and set them both to the exact same format (e.g., General or Text).
Does the store number have to be in the first column for VLOOKUP to work?
Yes, when using VLOOKUP, the lookup value (your store number) must strictly be located in the very first column of your selected table array. If it is not, the formula will fail. Alternatively, you can use XLOOKUP or an INDEX and MATCH combination, which do not have this restriction.
How do I return multiple columns of data at once using VLOOKUP?
Instead of typing a single number for the column index, you can use the COLUMN() function or input an array constant (e.g., {2,3,4,5}). This enables you to drag the formula across multiple columns to fetch all corresponding details simultaneously.




