Function Problems

How to Auto-Fill Name and Time from a Badge Scan in Excel

Camila MilosovichCamila Milosovich Oct 21, 2026 869 views

Question details

The user needs to set up an Excel sheet that automatically retrieves a person's name and employer, and records the current time, when a badge number is scanned.

How to Automatically Fill Name, Employer, and Time in Excel After a Badge Scan
Product
Excel
Device & OS
not provided
Scenario
Tracking attendance or logging entry by scanning a physical badge barcode into a spreadsheet to retrieve linked personnel data.
Observed behavior
Requires a lookup function to fetch information from a master reference sheet and a method to stamp the time of the scan without the time constantly recalculating.
Before you start

Ensure your barcode scanner is plugged in and configured as a 'keyboard wedge', meaning it automatically sends an 'Enter' or 'Return' keystroke immediately after reading a barcode.

Solution 1Recommended

Use XLOOKUP to Retrieve Details from a Master Sheet

Set up an automatic lookup system that cross-references the scanned badge number with a master employee or student directory.

To make this work seamlessly, you will use two separate worksheets. One acts as a permanent database (master list), and the other acts as the daily scanning interface. The XLOOKUP function is ideal for this because it searches for the scanned badge ID and returns the corresponding data.

1
Prepare the Master Data Sheet

Create a new worksheet and name it 'Sheet2'. Set up columns for Name in Column A, Employer in Column B, and Badge Number in Column C. Fill this sheet with your complete roster of personnel and their corresponding badge numbers.

2
Set Up the Scanning Interface

Go to 'Sheet1' and create headers: Badge Number (A1), Name (B1), Employer (C1), and Time (D1).

3
Apply the Name Lookup Formula

In cell B2 of Sheet1, type the formula: =XLOOKUP(A2,Sheet2!C:C,Sheet2!A:A,"Not found"). This tells Excel to look for the badge number from A2 in Sheet2's Column C, and return the matching Name from Column A.

4
Apply the Employer Lookup Formula

In cell C2 of Sheet1, type the formula: =XLOOKUP(A2,Sheet2!C:C,Sheet2!B:B,"Not found"). Drag both formulas down their respective columns so they are ready for multiple scans.

5
Scan the Badge

Click into cell A2 on Sheet1. Use your badge scanner to scan a barcode. The scanner will input the number, move to the next row, and the formulas will instantly populate the Name and Employer.

Use XLOOKUP to Retrieve Details from a Master Sheet
No Need for Manual Linking: You do not need to link every badge to every name individually in the scanning sheet. As long as the master list on Sheet 2 is accurate, the XLOOKUP formula dynamically finds the match for you.
Efficiently Track Attendance with WPS Spreadsheet

Easily Manage Badge Scans and Lookups in WPS Office

WPS Spreadsheet fully supports advanced lookup formulas like XLOOKUP, VLOOKUP, and IF functions, making it perfect for building an automated badge scanning tracker for your organization or nonprofit.

  1. 1. Create a New Tracker: Open WPS Spreadsheet and start a blank workbook for your attendance or entry tracker.
  2. 2. Input Master Data: Create your master data directory on Sheet 2 with Badge ID, Name, and Employer columns.
  3. 3. Apply Lookup Formulas: On Sheet 1, set up your scanning columns and input the XLOOKUP formulas to reference Sheet 2.
  4. 4. Start Scanning: Click into your first Badge Number cell and begin scanning with your barcode reader. The data will populate instantly.
100% compatible with Microsoft Excel file formats (.xlsx)Fully supports advanced lookup functions including XLOOKUPLightweight application with a familiar, easy-to-use interfaceFree to use for daily spreadsheet tracking needs
microsoft office alternative - wps office

Frequently Asked Questions

What type of badge scanner works with Excel?

Almost any standard USB or Bluetooth barcode scanner will work. Computers treat barcode scanners exactly like external keyboards. When you scan a badge, the scanner simply "types" the badge number very quickly and usually presses the "Enter" key automatically.

Do I need to match every name with every badge number individually?

No. You only need to create a master list (database) on a separate worksheet once. The XLOOKUP or VLOOKUP formula will search the entire column automatically and match the scanned badge number to the correct person without any manual linking on the scanning page.

Why does my NOW() timestamp keep changing every time I scan a new badge?

The NOW() function in spreadsheet software is volatile, meaning it refreshes every time any data is modified anywhere in the workbook. To fix this, you must either enable Iterative Calculation to create a circular reference time-lock formula, or use a VBA Macro to paste the time as a static text value.