Function Problems

How to Use the First Three VIN Characters in an Excel IF Formula

Kushani NimanthikaKushani Nimanthika Nov 10, 2026 868 views

Question details

The user needs to extract the first three characters of a Vehicle Identification Number (VIN) to determine the vehicle manufacturer using spreadsheet formulas.

How to Use the First Three VIN Characters in an Excel IF Formula
Product
Microsoft Excel
Device & OS
not provided
Scenario
Analyzing vehicle data by parsing the standard 3-character World Manufacturer Identifier (WMI) at the start of a VIN string.
Observed behavior
The user wants to construct an accurate, scalable formula using functions like LEFT, IF, or XLOOKUP to output the correct vehicle brand dynamically.
Before you start

Ensure your VIN data is formatted as text and doesn't contain hidden leading spaces. It is also helpful to prepare a lookup list of standard VIN manufacturer codes if you plan to identify multiple vehicle brands.

Solution 1Recommended

Use LEFT and XLOOKUP to Identify Manufacturers (Recommended)

A highly scalable lookup-table approach allows you to add or modify manufacturer codes without rewriting complex nested formulas.

While IF statements work for simple comparisons, using an XLOOKUP table is much easier to maintain when you have dozens of vehicle manufacturers.

1
Create a Reference Table

Set up a new table in your worksheet or a separate sheet named 'Makes'. Create two columns: 'Make' (for the 3-character codes like '1GB') and 'Brand' (for the names like 'Chevrolet').

2
Select the Target Cell

Click on the empty cell adjacent to your VIN where you want the manufacturer name to appear.

3
Enter the XLOOKUP Formula

Assuming your VIN is in cell D2, type =XLOOKUP(LEFT(D2,3),Makes[Make],Makes[Brand],"") and press Enter.

4
Apply to the Entire Column

Click on the cell with your new formula, grab the fill handle in the bottom-right corner, and drag it down to apply the formula to the rest of your VIN list.

Use LEFT and XLOOKUP to Identify Manufacturers (Recommended)
Easy Maintenance: Using a table means you can simply add new rows for new manufacturer codes later, and your XLOOKUP formula will automatically include them without needing adjustments.
Advanced Spreadsheet Functions

Easily Manage Complex Formulas with WPS Spreadsheet

WPS Spreadsheet offers robust support for advanced functions like IF, LEFT, and XLOOKUP, allowing you to seamlessly process VIN numbers and large datasets. It is fully compatible with Excel formulas, making data parsing incredibly simple.

  1. 1. Download and Install WPS Office: Get WPS Office from the official website and complete the quick installation.
  2. 2. Open Your Vehicle Data: Launch WPS Spreadsheet and open your existing .xlsx or .csv dataset containing the VIN numbers.
  3. 3. Insert the Formula: Select the target cell, then navigate to the Formulas tab to insert your preferred LEFT, IF, or XLOOKUP function.
  4. 4. Process Your Dataset: Double-click the fill handle on the cell to instantly apply your manufacturer identification formula across thousands of rows.
Fully compatible with Microsoft Excel formulas and .xlsx files.Supports advanced lookup functions like XLOOKUP, VLOOKUP, and nested IFs.Lightweight, fast, and free to use for daily data processing.Clean and familiar user interface with no learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my LEFT function returning an error or incorrect value?

This typically occurs if there are hidden leading spaces in your VIN data. You can fix this by wrapping the cell reference in the TRIM function, like this: =LEFT(TRIM(D2), 3).

Can I use VLOOKUP instead of XLOOKUP for this task?

Yes. If XLOOKUP is not available on your spreadsheet version, you can use VLOOKUP by typing =VLOOKUP(LEFT(D2,3), MakesTable, 2, FALSE). Ensure your reference table has the 3-character codes located in the very first column.

Does the IF function in Excel distinguish between uppercase and lowercase letters?

No, the standard IF function is not case-sensitive. '1GB' and '1gb' will be treated as the same value. If you need strict case sensitivity, you must combine the IF function with the EXACT function.