IFERROR

Logicalbeginner

IFERROR wraps around another formula and catches any error (#N/A, #VALUE!, #DIV/0!, etc.), replacing it with a value you choose. It's essential for building robust spreadsheets that don't break when data is missing or unexpected. Think of it as a safety net around your formulas.

Syntax

Excel:=IFERROR(value, value_if_error)
Google Sheets: Same syntax

Parameters

valueThe formula or expression to evaluate.
value_if_errorWhat to return if the formula errors.

? = optional parameter

Worked Example

You're looking up invoice 'INV-9998' which doesn't exist in the visible sample. Without IFERROR, VLOOKUP returns #N/A.

Row numbersAB
Header rowinvoice_idvendor_name
2INV-1001Cloudline Software
3INV-1002Apex Office Supply
4INV-1003Summit Consulting Group
5INV-1004Meridian Travel Co.
6INV-9999← doesn't exist

Formula

=IFERROR(VLOOKUP("INV-9998", A2:B6, 2, FALSE), "Not Found")

Result

Not Found

VLOOKUP searches A2:B6 for 'INV-9998'. Because that invoice ID does not appear anywhere in rows 2 through 6, VLOOKUP returns #N/A and IFERROR replaces it with 'Not Found'.

Practice Exercises

2 exercises - work through each one using the data table below

Exercise 1 of 2intermediate
#IFERROR-001

Question

You're using VLOOKUP to find invoice details, but some invoice IDs may not exist. What does the following formula return when 'INV-9999' is not found in the dataset? =IFERROR(VLOOKUP("INV-9999", A2:I151, 2, FALSE), "Invoice not found")

Dataset

Vendor Spend Tracker (150 rows total)

Download CSV
Row numbersABC
Header row
2INV-1001Cloudline SoftwareSoftware
3INV-1002Apex Office SupplyOffice Supplies
4INV-1003Summit Consulting GroupConsulting
5INV-1004Meridian Travel Co.Travel
6INV-1005Forge & Frame CreativeMarketing
7INV-1006NovaTech SolutionsSoftware
8INV-1007Atlas Hardware Co.Hardware
9INV-1008Clearview Data SystemsSoftware
10INV-1009Redstone MarketingMarketing
11INV-1010Keystone Legal AdvisorsConsulting
12INV-1011Cloudline SoftwareSoftware
13INV-1012Basecamp EventsMarketing
14INV-1013Apex Office SupplyOffice Supplies
15INV-1014BrightPath AnalyticsSoftware
16INV-1015Meridian Travel Co.Travel
17INV-1016Clearview Data SystemsSoftware
18INV-1017Apex Office SupplyOffice Supplies
19INV-1018Summit Consulting GroupConsulting
20INV-1019Cloudline SoftwareSoftware
21INV-1020Atlas Hardware Co.Hardware
22INV-1021Meridian Travel Co.Travel
23INV-1022Atlas Hardware Co.Hardware
24INV-1023Atlas Hardware Co.Hardware
25INV-1024Apex Office SupplyOffice Supplies
26INV-1025Redstone MarketingMarketing
27INV-1026Clearview Data SystemsSoftware
28INV-1027Horizon IT ServicesSoftware
29INV-1028Basecamp EventsMarketing
30INV-1029Redstone MarketingMarketing
31INV-1030BrightPath AnalyticsSoftware
32INV-1031Basecamp EventsMarketing
33INV-1032Cloudline SoftwareSoftware
34INV-1033Clearview Data SystemsSoftware
35INV-1034Meridian Travel Co.Travel
36INV-1035Cloudline SoftwareSoftware
37INV-1036Horizon IT ServicesSoftware
38INV-1037BrightPath AnalyticsSoftware
39INV-1038Cloudline SoftwareSoftware
40INV-1039Horizon IT ServicesSoftware
41INV-1040Apex Office SupplyOffice Supplies
42INV-1041Summit Consulting GroupConsulting
43INV-1042Clearview Data SystemsSoftware
44INV-1043Forge & Frame CreativeMarketing
45INV-1044NovaTech SolutionsSoftware
46INV-1045Meridian Travel Co.Travel
47INV-1046Cloudline SoftwareSoftware
48INV-1047Apex Office SupplyOffice Supplies
49INV-1048Apex Office SupplyOffice Supplies
50INV-1049Pinecrest StaffingConsulting
51INV-1050Clearview Data SystemsSoftware
52INV-1051BrightPath AnalyticsSoftware
53INV-1052Keystone Legal AdvisorsConsulting
54INV-1053Cloudline SoftwareSoftware
55INV-1054NovaTech SolutionsSoftware
56INV-1055Basecamp EventsMarketing
57INV-1056Cloudline SoftwareSoftware
58INV-1057NovaTech SolutionsSoftware
59INV-1058Clearview Data SystemsSoftware
60INV-1059Basecamp EventsMarketing
61INV-1060Horizon IT ServicesSoftware
62INV-1061Atlas Hardware Co.Hardware
63INV-1062Forge & Frame CreativeMarketing
64INV-1063Meridian Travel Co.Travel
65INV-1064Meridian Travel Co.Travel
66INV-1065Cloudline SoftwareSoftware
67INV-1066Redstone MarketingMarketing
68INV-1067Horizon IT ServicesSoftware
69INV-1068Cloudline SoftwareSoftware
70INV-1069NovaTech SolutionsSoftware
71INV-1070Apex Office SupplyOffice Supplies
72INV-1071Redstone MarketingMarketing
73INV-1072NovaTech SolutionsSoftware
74INV-1073Summit Consulting GroupConsulting
75INV-1074Atlas Hardware Co.Hardware
76INV-1075BrightPath AnalyticsSoftware
77INV-1076Clearview Data SystemsSoftware
78INV-1077Meridian Travel Co.Travel
79INV-1078Pinecrest StaffingConsulting
80INV-1079Meridian Travel Co.Travel
81INV-1080Greenfield FacilitiesOffice Supplies
82INV-1081Keystone Legal AdvisorsConsulting
83INV-1082Apex Office SupplyOffice Supplies
84INV-1083Cloudline SoftwareSoftware
85INV-1084Meridian Travel Co.Travel
86INV-1085Horizon IT ServicesSoftware
87INV-1086Cloudline SoftwareSoftware
88INV-1087Apex Office SupplyOffice Supplies
89INV-1088Pinecrest StaffingConsulting
90INV-1089NovaTech SolutionsSoftware
91INV-1090Meridian Travel Co.Travel
92INV-1091Redstone MarketingMarketing
93INV-1092Cloudline SoftwareSoftware
94INV-1093Cloudline SoftwareSoftware
95INV-1094BrightPath AnalyticsSoftware
96INV-1095Redstone MarketingMarketing
97INV-1096BrightPath AnalyticsSoftware
98INV-1097Redstone MarketingMarketing
99INV-1098Cloudline SoftwareSoftware
100INV-1099Meridian Travel Co.Travel
101INV-1100Meridian Travel Co.Travel
102INV-1101Forge & Frame CreativeMarketing
103INV-1102Atlas Hardware Co.Hardware
104INV-1103NovaTech SolutionsSoftware
105INV-1104Meridian Travel Co.Travel
106INV-1105NovaTech SolutionsSoftware
107INV-1106Pinecrest StaffingConsulting
108INV-1107Basecamp EventsMarketing
109INV-1108Redstone MarketingMarketing
110INV-1109NovaTech SolutionsSoftware
111INV-1110Horizon IT ServicesSoftware
112INV-1111Pinecrest StaffingConsulting
113INV-1112NovaTech SolutionsSoftware
114INV-1113Cloudline SoftwareSoftware
115INV-1114Meridian Travel Co.Travel
116INV-1115Clearview Data SystemsSoftware
117INV-1116Cloudline SoftwareSoftware
118INV-1117Clearview Data SystemsSoftware
119INV-1118Greenfield FacilitiesOffice Supplies
120INV-1119Cloudline SoftwareSoftware
121INV-1120Horizon IT ServicesSoftware
122INV-1121Meridian Travel Co.Travel
123INV-1122Redstone MarketingMarketing
124INV-1123Redstone MarketingMarketing
125INV-1124NovaTech SolutionsSoftware
126INV-1125Cloudline SoftwareSoftware
127INV-1126Meridian Travel Co.Travel
128INV-1127Horizon IT ServicesSoftware
129INV-1128Forge & Frame CreativeMarketing
130INV-1129Cloudline SoftwareSoftware
131INV-1130BrightPath AnalyticsSoftware
132INV-1131Keystone Legal AdvisorsConsulting
133INV-1132BrightPath AnalyticsSoftware
134INV-1133Meridian Travel Co.Travel
135INV-1134NovaTech SolutionsSoftware
136INV-1135Cloudline SoftwareSoftware
137INV-1136Greenfield FacilitiesOffice Supplies
138INV-1137Meridian Travel Co.Travel
139INV-1138Apex Office SupplyOffice Supplies
140INV-1139Pinecrest StaffingConsulting
141INV-1140Pinecrest StaffingConsulting
142INV-1141Cloudline SoftwareSoftware
143INV-1142NovaTech SolutionsSoftware
144INV-1143Greenfield FacilitiesOffice Supplies
145INV-1144Clearview Data SystemsSoftware
146INV-1145Apex Office SupplyOffice Supplies
147INV-1146Cloudline SoftwareSoftware
148INV-1147Summit Consulting GroupConsulting
149INV-1148NovaTech SolutionsSoftware
150INV-1149Greenfield FacilitiesOffice Supplies
151INV-1150Greenfield FacilitiesOffice Supplies
152

Scroll to explore the table, then sort or filter by column as needed.

Hints

Your Answer

Exercise 2 of 2intermediate
#IFERROR-002

Question

A colleague's formula divides the total spend by the count of invoices in a category — but for a category with zero invoices, it hits a #DIV/0! error. What does =IFERROR(SUM(E2:E10)/0, "N/A") return?

Dataset

Vendor Spend Tracker (150 rows total)

Download CSV
Row numbersABCD
Header row
2INV-1001Cloudline SoftwareSoftware$12,500.00
3INV-1002Apex Office SupplyOffice Supplies$487.50
4INV-1003Summit Consulting GroupConsulting$18,750.00
5INV-1004Meridian Travel Co.Travel$3,200.00
6INV-1005Forge & Frame CreativeMarketing$7,600.00
7INV-1006NovaTech SolutionsSoftware$9,800.00
8INV-1007Atlas Hardware Co.Hardware$2,150.00
9INV-1008Clearview Data SystemsSoftware$15,300.00
10INV-1009Redstone MarketingMarketing$4,250.00
11INV-1010Keystone Legal AdvisorsConsulting$8,900.00
12INV-1011Cloudline SoftwareSoftware$8,500.00
13INV-1012Basecamp EventsMarketing$8,256.80
14INV-1013Apex Office SupplyOffice Supplies$713.88
15INV-1014BrightPath AnalyticsSoftware$2,645.33
16INV-1015Meridian Travel Co.Travel$4,702.01
17INV-1016Clearview Data SystemsSoftware$3,400.74
18INV-1017Apex Office SupplyOffice Supplies$531.83
19INV-1018Summit Consulting GroupConsulting$1,847.86
20INV-1019Cloudline SoftwareSoftware$7,800.00
21INV-1020Atlas Hardware Co.Hardware$2,524.82
22INV-1021Meridian Travel Co.Travel$2,934.55
23INV-1022Atlas Hardware Co.Hardware$2,912.75
24INV-1023Atlas Hardware Co.Hardware$4,124.04
25INV-1024Apex Office SupplyOffice Supplies$672.77
26INV-1025Redstone MarketingMarketing$5,371.63
27INV-1026Clearview Data SystemsSoftware$3,796.96
28INV-1027Horizon IT ServicesSoftware$1,773.30
29INV-1028Basecamp EventsMarketing$4,601.68
30INV-1029Redstone MarketingMarketing$5,414.85
31INV-1030BrightPath AnalyticsSoftware$2,704.87
32INV-1031Basecamp EventsMarketing$2,351.63
33INV-1032Cloudline SoftwareSoftware$9,200.00
34INV-1033Clearview Data SystemsSoftware$4,086.27
35INV-1034Meridian Travel Co.Travel$1,642.50
36INV-1035Cloudline SoftwareSoftware$2,867.94
37INV-1036Horizon IT ServicesSoftware$4,586.87
38INV-1037BrightPath AnalyticsSoftware$2,679.33
39INV-1038Cloudline SoftwareSoftware$2,284.90
40INV-1039Horizon IT ServicesSoftware$3,224.17
41INV-1040Apex Office SupplyOffice Supplies$604.96
42INV-1041Summit Consulting GroupConsulting$9,500.00
43INV-1042Clearview Data SystemsSoftware$3,871.90
44INV-1043Forge & Frame CreativeMarketing$5,726.55
45INV-1044NovaTech SolutionsSoftware$3,596.33
46INV-1045Meridian Travel Co.Travel$5,657.73
47INV-1046Cloudline SoftwareSoftware$8,000.00
48INV-1047Apex Office SupplyOffice Supplies$396.69
49INV-1048Apex Office SupplyOffice Supplies$523.99
50INV-1049Pinecrest StaffingConsulting$5,843.41
51INV-1050Clearview Data SystemsSoftware$5,091.38
52INV-1051BrightPath AnalyticsSoftware$6,200.00
53INV-1052Keystone Legal AdvisorsConsulting$10,496.53
54INV-1053Cloudline SoftwareSoftware$3,873.77
55INV-1054NovaTech SolutionsSoftware$2,131.07
56INV-1055Basecamp EventsMarketing$4,659.43
57INV-1056Cloudline SoftwareSoftware$7,500.00
58INV-1057NovaTech SolutionsSoftware$3,255.52
59INV-1058Clearview Data SystemsSoftware$2,889.22
60INV-1059Basecamp EventsMarketing$2,943.88
61INV-1060Horizon IT ServicesSoftware$3,917.25
62INV-1061Atlas Hardware Co.Hardware$2,958.71
63INV-1062Forge & Frame CreativeMarketing$5,190.48
64INV-1063Meridian Travel Co.Travel$3,800.00
65INV-1064Meridian Travel Co.Travel$3,248.96
66INV-1065Cloudline SoftwareSoftware$6,800.00
67INV-1066Redstone MarketingMarketing$4,583.65
68INV-1067Horizon IT ServicesSoftware$4,154.73
69INV-1068Cloudline SoftwareSoftware$1,994.85
70INV-1069NovaTech SolutionsSoftware$5,988.79
71INV-1070Apex Office SupplyOffice Supplies$701.90
72INV-1071Redstone MarketingMarketing$1,522.67
73INV-1072NovaTech SolutionsSoftware$8,100.00
74INV-1073Summit Consulting GroupConsulting$33,000.00
75INV-1074Atlas Hardware Co.Hardware$3,618.53
76INV-1075BrightPath AnalyticsSoftware$5,484.82
77INV-1076Clearview Data SystemsSoftware$2,190.73
78INV-1077Meridian Travel Co.Travel$4,915.98
79INV-1078Pinecrest StaffingConsulting$5,337.06
80INV-1079Meridian Travel Co.Travel$5,217.40
81INV-1080Greenfield FacilitiesOffice Supplies$4,199.01
82INV-1081Keystone Legal AdvisorsConsulting$7,880.94
83INV-1082Apex Office SupplyOffice Supplies$738.04
84INV-1083Cloudline SoftwareSoftware$9,500.00
85INV-1084Meridian Travel Co.Travel$3,706.27
86INV-1085Horizon IT ServicesSoftware$3,934.09
87INV-1086Cloudline SoftwareSoftware$2,463.38
88INV-1087Apex Office SupplyOffice Supplies$404.67
89INV-1088Pinecrest StaffingConsulting$1,909.04
90INV-1089NovaTech SolutionsSoftware$2,885.01
91INV-1090Meridian Travel Co.Travel$5,922.08
92INV-1091Redstone MarketingMarketing$3,693.48
93INV-1092Cloudline SoftwareSoftware$4,986.06
94INV-1093Cloudline SoftwareSoftware$31,500.00
95INV-1094BrightPath AnalyticsSoftware$4,248.05
96INV-1095Redstone MarketingMarketing$3,264.04
97INV-1096BrightPath AnalyticsSoftware$5,977.55
98INV-1097Redstone MarketingMarketing$3,214.26
99INV-1098Cloudline SoftwareSoftware$8,200.00
100INV-1099Meridian Travel Co.Travel$2,709.54
101INV-1100Meridian Travel Co.Travel$3,516.17
102INV-1101Forge & Frame CreativeMarketing$3,122.47
103INV-1102Atlas Hardware Co.Hardware$4,530.21
104INV-1103NovaTech SolutionsSoftware$4,352.17
105INV-1104Meridian Travel Co.Travel$3,137.30
106INV-1105NovaTech SolutionsSoftware$4,559.89
107INV-1106Pinecrest StaffingConsulting$7,400.00
108INV-1107Basecamp EventsMarketing$2,724.75
109INV-1108Redstone MarketingMarketing$3,957.64
110INV-1109NovaTech SolutionsSoftware$2,398.15
111INV-1110Horizon IT ServicesSoftware$5,015.14
112INV-1111Pinecrest StaffingConsulting$30,500.00
113INV-1112NovaTech SolutionsSoftware$3,646.25
114INV-1113Cloudline SoftwareSoftware$5,200.86
115INV-1114Meridian Travel Co.Travel$1,878.57
116INV-1115Clearview Data SystemsSoftware$4,287.78
117INV-1116Cloudline SoftwareSoftware$5,505.30
118INV-1117Clearview Data SystemsSoftware$4,658.66
119INV-1118Greenfield FacilitiesOffice Supplies$5,042.80
120INV-1119Cloudline SoftwareSoftware$7,000.00
121INV-1120Horizon IT ServicesSoftware$3,893.42
122INV-1121Meridian Travel Co.Travel$5,864.21
123INV-1122Redstone MarketingMarketing$3,920.27
124INV-1123Redstone MarketingMarketing$4,600.00
125INV-1124NovaTech SolutionsSoftware$1,602.74
126INV-1125Cloudline SoftwareSoftware$5,250.09
127INV-1126Meridian Travel Co.Travel$4,417.14
128INV-1127Horizon IT ServicesSoftware$5,900.00
129INV-1128Forge & Frame CreativeMarketing$4,618.54
130INV-1129Cloudline SoftwareSoftware$8,800.00
131INV-1130BrightPath AnalyticsSoftware$4,003.25
132INV-1131Keystone Legal AdvisorsConsulting$11,892.88
133INV-1132BrightPath AnalyticsSoftware$2,800.34
134INV-1133Meridian Travel Co.Travel$4,365.68
135INV-1134NovaTech SolutionsSoftware$2,264.09
136INV-1135Cloudline SoftwareSoftware$5,344.04
137INV-1136Greenfield FacilitiesOffice Supplies$1,733.29
138INV-1137Meridian Travel Co.Travel$2,251.07
139INV-1138Apex Office SupplyOffice Supplies$367.30
140INV-1139Pinecrest StaffingConsulting$3,235.55
141INV-1140Pinecrest StaffingConsulting$4,538.25
142INV-1141Cloudline SoftwareSoftware$7,200.00
143INV-1142NovaTech SolutionsSoftware$2,487.53
144INV-1143Greenfield FacilitiesOffice Supplies$4,398.73
145INV-1144Clearview Data SystemsSoftware$4,282.05
146INV-1145Apex Office SupplyOffice Supplies$300.36
147INV-1146Cloudline SoftwareSoftware$9,000.00
148INV-1147Summit Consulting GroupConsulting$4,697.90
149INV-1148NovaTech SolutionsSoftware$2,613.37
150INV-1149Greenfield FacilitiesOffice Supplies$4,097.38
151INV-1150Greenfield FacilitiesOffice Supplies$1,846.11
152

Scroll to explore the table, then sort or filter by column as needed.

Hints

Your Answer

Want more practice?

Test Me mode randomizes exercises across all formulas without telling you which formula to use.

Try Test Me ->