Lookup with IFERROR Excel Practice Question with Solutions

Introduction

Excel lookups become more useful when your data is incomplete, contains partial text, or requires approximate matching. In this chapter, you will practice IFERROR, wildcard characters such as * and ?, and approximate matching with VLOOKUP, XLOOKUP, and MATCH. These practical questions cover employee records, product searches, grading systems, commission rates, tax slabs, and sales data. Lookup with IFERROR Excel Practice Question with Solutions to help you understand the concepts.

Question 1: Handle a Missing Product with IFERROR and VLOOKUP

Problem Statement

Find the price of each product using VLOOKUP. If a product does not exist, display "Product Not Found" instead of #N/A.

Excel Data

Product IDProductPrice
P101Keyboard850
P102Mouse550
P103Monitor12500
P104Webcam2200
P105Headset1800

Search Data

Product IDPrice
P103
P109
P101
P110
P105

Excel Solution

In B9, enter:

=IFERROR(VLOOKUP(A9,$A$2:$C$6,3,FALSE),"Product Not Found")

Copy the formula down.

Expected Output

Product IDPrice
P10312500
P109Product Not Found
P101850
P110Product Not Found
P1051800

Concepts Covered

  • VLOOKUP
  • IFERROR
  • Exact match
  • Handling #N/A

Question 2: Use XLOOKUP with IFERROR-Style Error Handling

Problem Statement

Find an employee’s department using their Employee ID. If the ID does not exist, display "Employee Not Found".

Excel Data

Employee IDEmployeeDepartment
E101RahulIT
E102PriyaHR
E103AmitSales
E104NehaFinance
E105ArjunIT

Search Data

Employee IDDepartment
E102
E108
E104
E110
E101

Excel Solution

In B9, enter:

=XLOOKUP(A9,$A$2:$A$6,$C$2:$C$6,"Employee Not Found")

Copy the formula down.

Expected Output

Employee IDDepartment
E102HR
E108Employee Not Found
E104Finance
E110Employee Not Found
E101IT

XLOOKUP has its own if_not_found argument, so IFERROR is not required for this particular case.


Question 3: Find Products Using a Wildcard

Problem Statement

Find the first product whose name starts with "Key".

Excel Data

Product IDProductPrice
P101Keyboard850
P102Mouse550
P103Monitor12500
P104Webcam2200
P105Keypad700

Search Data

Search TextProduct
Key
Web
Mon
Mou
Head

Excel Solution

Using XLOOKUP, enter:

=XLOOKUP(A9&"*",$B$2:$B$6,$B$2:$B$6,"Not Found",2)

Copy the formula down.

Expected Output

Search TextProduct
KeyKeyboard
WebWebcam
MonMonitor
MouMouse
HeadNot Found

The * wildcard means any number of characters can appear after the search text.

For example:

Key*

can match:

  • Keyboard
  • Keypad

XLOOKUP returns the first matching result.


Question 4: Search for Text Containing a Specific Word

Problem Statement

Find the first product whose name contains "Pro" anywhere in the product name.

Excel Data

Product IDProduct
P101Keyboard Pro
P102Wireless Mouse
P103Monitor Pro
P104Pro Webcam
P105Gaming Headset

Search Data

Search TextMatching Product
Pro
Mouse
Gaming
Wireless
Headset

Excel Solution

In B9, enter:

=XLOOKUP("*"&A9&"*",$B$2:$B$6,$B$2:$B$6,"Not Found",2)

Copy down.

Expected Output

Search TextMatching Product
ProKeyboard Pro
MouseWireless Mouse
GamingGaming Headset
WirelessWireless Mouse
HeadsetGaming Headset

The formula:

"*"&A9&"*"

allows characters to appear before and after the search text.


Question 5: Use the ? Wildcard

Problem Statement

Use the ? wildcard to find product codes where one character can vary.

Excel Data

Product CodeProduct
AB101Keyboard
AB102Mouse
AB103Monitor
AC101Webcam
AC102Headset

Search Data

PatternProduct
AB10?
AC10?
AB101
AC102

Excel Solution

In B9, enter:

=XLOOKUP(A9,$A$2:$A$6,$B$2:$B$6,"Not Found",2)

Copy down.

Expected Output

PatternProduct
AB10?Keyboard
AC10?Webcam
AB101Keyboard
AC102Headset

The ? wildcard represents exactly one character.

For example:

AB10?

can match:

  • AB101
  • AB102
  • AB103

Question 6: Approximate Match for Commission Rates

Problem Statement

A company gives different commission rates based on sales amount.

Find the commission rate for each salesperson.

Commission Table

Minimum SalesCommission Rate
02%
250003%
500005%
750007%
10000010%

Sales Data

SalespersonSalesCommission Rate
Rahul18000
Priya42000
Amit68000
Neha92000
Arjun125000

Excel Solution

In C9, enter:

=VLOOKUP(B9,$A$2:$B$6,2,TRUE)

Copy down.

Expected Output

SalespersonSalesCommission Rate
Rahul180002%
Priya420003%
Amit680005%
Neha920007%
Arjun12500010%

Important

For approximate VLOOKUP, the first column of the lookup table must be sorted in ascending order.

For example:

0
25000
50000
75000
100000

Question 7: Approximate Match for Student Grades

Problem Statement

Assign a grade based on a student’s marks.

Grade Table

Minimum MarksGrade
0F
40D
50C
60B
75A
90A+

Student Data

StudentMarksGrade
Rahul38
Priya54
Amit68
Neha82
Arjun94

Excel Solution

In C9, enter:

=VLOOKUP(B9,$A$2:$B$7,2,TRUE)

Copy down.

Expected Output

StudentMarksGrade
Rahul38F
Priya54C
Amit68B
Neha82A
Arjun94A+

Concepts Covered

  • Approximate matching
  • Grading system
  • VLOOKUP
  • Sorted lookup table

Question 8: Approximate MATCH for a Tax Slab

Problem Statement

Find the applicable tax slab based on annual income.

Tax Table

Minimum IncomeTax Rate
00%
3000005%
60000010%
90000015%
120000020%

Income Data

PersonAnnual IncomeTax Rate
Rahul250000
Priya450000
Amit750000
Neha1000000
Arjun1500000

Excel Solution

Use INDEX and approximate MATCH:

=INDEX($B$2:$B$6,MATCH(B9,$A$2:$A$6,1))

Copy down.

Expected Output

PersonAnnual IncomeTax Rate
Rahul2500000%
Priya4500005%
Amit75000010%
Neha100000015%
Arjun150000020%

The 1 in MATCH finds the largest value that is less than or equal to the lookup value.


Question 9: Approximate XLOOKUP for Delivery Charges

Problem Statement

A delivery company charges different fees based on package weight.

Find the delivery charge for each package.

Delivery Table

Minimum Weight (kg)Delivery Charge
050
270
5100
10150
20250

Package Data

PackageWeightDelivery Charge
A1
B4
C7
D15
E25

Excel Solution

In C9, enter:

=XLOOKUP(B9,$A$2:$A$6,$B$2:$B$6,,-1)

Copy down.

Expected Output

PackageWeightDelivery Charge
A150
B470
C7100
D15150
E25250

The -1 match mode tells XLOOKUP to find an exact match or the next smaller value.


Question 10: Combine Wildcard Lookup, IFERROR and XLOOKUP

Problem Statement

Create a product search system where the user enters part of a product name.

The formula should:

  • Find a product containing the entered text.
  • Return its price.
  • Display "Product Not Found" if there is no match.

Excel Data

Product IDProductCategoryPrice
P101Wireless KeyboardAccessories1200
P102Wireless MouseAccessories750
P103Gaming MonitorDisplay15000
P104HD WebcamAccessories2500
P105Gaming HeadsetAudio2200

Search Data

Search TextPrice
Wireless
Gaming
Webcam
Keyboard
Tablet

Excel Solution

In B9, enter:

=IFERROR(XLOOKUP("*"&A9&"*",$B$2:$B$6,$D$2:$D$6,"Product Not Found",2),"Product Not Found")

Copy down.

Expected Output

Search TextPrice
Wireless1200
Gaming15000
Webcam2500
Keyboard1200
TabletProduct Not Found

Concepts Covered

  • XLOOKUP
  • Wildcard search
  • * wildcard
  • IFERROR
  • Partial-text lookup
  • Error handling
  • Practical product search

Key Takeaways

  • IFERROR can replace lookup errors with a useful message.
  • XLOOKUP has an if_not_found argument, so IFERROR is not always necessary.
  • The * wildcard represents zero or more characters.
  • The ? wildcard represents exactly one character.
  • Wildcards are useful when you know only part of a text value.
  • VLOOKUP(...,TRUE) can perform approximate matching.
  • Approximate lookup tables must be sorted correctly.
  • MATCH(...,1) can perform approximate matching when the lookup table is sorted in ascending order.
  • XLOOKUP can use -1 to find an exact match or the next smaller value.
  • Approximate matching is useful for grades, commissions, tax slabs, delivery charges, discounts, and pricing tiers.
  • Wildcard lookup is useful for product searches, customer searches, employee names, and partially known text.

FAQs

1. What is a wildcard in Excel?

A wildcard is a special character that allows Excel to search for patterns instead of requiring an exact text match.

The two main wildcards are:

*
?

2. What does * mean in Excel?

* represents any number of characters.

For example:

"*phone*"

can find text containing "phone" anywhere in the cell.

3. What does ? mean in Excel?

? represents exactly one character.

For example:

AB10?

can match:

AB101
AB102
AB103

4. What is approximate matching in Excel?

Approximate matching finds the closest applicable value instead of requiring an exact match.

For example, a sales amount of ₹68,000 can fall into the ₹50,000 commission slab.

5. When should I use approximate VLOOKUP?

Approximate VLOOKUP is useful when you have ranges or slabs such as:

  • Marks and grades
  • Sales and commissions
  • Income and tax rates
  • Weight and delivery charges
  • Purchase amount and discounts

6. Does approximate VLOOKUP require sorted data?

Yes. When using:

=VLOOKUP(A2,table,2,TRUE)

the first column of the lookup table should normally be sorted in ascending order.

7. What is approximate MATCH?

Approximate MATCH can find the position of the largest value that is less than or equal to the lookup value when using:

=MATCH(A2,B2:B10,1)

The lookup range needs to be sorted in ascending order.

8. Can XLOOKUP use wildcards?

Yes. With the appropriate match mode, XLOOKUP can perform wildcard matching.

For example:

=XLOOKUP("*"&A2&"*",B2:B10,C2:C10,"Not Found",2)

9. What is the difference between * and ??

* can represent zero, one, or many characters.

? represents exactly one character.

10. Can IFERROR be used with XLOOKUP in Excel?

Yes, although XLOOKUP already provides an if_not_found argument.

For example:

=XLOOKUP(A2,B2:B10,C2:C10,"Not Found")

is often enough to handle a missing lookup value.

Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.

Scroll to Top