Excel Exercise

Easy

3 minutes

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 cell C4. You can do this by dividing the number of drinks by the number of guests. Since there are 0 guests this time, we will run into a #DIV/0! error. In the interactive spreadsheet editor, you will actually get Infinity as the answer, but you can treat this as if it said #DIV/0!.

When you get this error, use the division as one of the arguments of the Iferror function to return the result of the division if there is no error and 0 otherwise.

Great work!

Related functions

IFERROR

__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"36c04":{"name":"Main Accent","parent":-1},"3a8fd":{"name":"Accent Light","parent":"36c04","lock":{"saturation":1,"lightness":1}}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"36c04":{"val":"rgb(255, 204, 102)","hsl":{"h":40,"s":1,"l":0.7}},"3a8fd":{"val":"rgb(241, 241, 241)","hsl_parent_dependency":{"h":0,"s":0,"l":0.94}}},"gradients":[]},"original":{"colors":{"36c04":{"val":"rgb(255, 204, 102)","hsl":{"h":40,"s":1,"l":0.7}},"3a8fd":{"val":"rgb(241, 241, 241)","hsl_parent_dependency":{"h":0,"s":0,"l":0.94}}},"gradients":[]}}]}__CONFIG_colors_palette__

​Get Good at Excel on Autopilot

Sign up to our newsletter and receive ​Excel articles, tips and tricks delivered straight to your inbox. All you have to do is read them! ​Plus, to get you started, you'll receive a PDF with 200+ Excel shortcuts.

__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"2dd0d":{"name":"Main Accent","parent":-1}},"gradients":[]},"palettes":[{"name":"Default Palette","value":{"colors":{"2dd0d":{"val":"rgb(45, 164, 92)","hsl":{"h":143,"s":0.57,"l":0.41}}},"gradients":[]},"original":{"colors":{"2dd0d":{"val":"rgb(19, 114, 211)","hsl":{"h":210,"s":0.83,"l":0.45}}},"gradients":[]}}]}__CONFIG_colors_palette__
Join List
>