Basic IFERROR exercise

Beginner

In this exercise, we're looking at the IFERROR function. This function can be handy when you expect errors to exist, but you want to handle them gracefully.

In the exercise, we are expecting an error, namely a #DIV/0! error that you get when you divide a number by 0. Since that's not allowed in mathematics, the error is reasonable, yet we still would like to return something other than an error. That's where IFERROR comes in.

Return the number of Drinks per guest in cells C2:C4. For each row, divide the number of drinks by the number of guests, and wrap that division in IFERROR so the formula returns the division result when there is no error and 0 otherwise.

Rows 2 and 3 should return the normal division result. Row 4 has 0 guests, so your IFERROR formula should return 0 instead of a #DIV/0! error.

Need some help?

Related function(s)