• 8 heures
  • Facile

Ce cours est visible gratuitement en ligne.

course.header.alt.is_video

course.header.alt.is_certifying

J'ai tout compris !

Mis à jour le 09/12/2022

Check if your data matches certain conditions with the IF function

Grasp the potential of IF

The powerful IF function allows you to compare what’s in one cell and what you expect, and then returns a result in the cell where the function is written.

It’s a little like the conditional formatting and the filtering you saw in previous chapters. In the case of conditional formatting, the format of a cell changed based on what was in it.

With filtering, data that didn’t match what we were looking for was hidden. The filter established a condition, which narrowed the data down to what we wanted to see.

Write an IF function

With the IF function, you can fill another cell with a particular content based on the conditions you ask your spreadsheet to verify. If the cell doesn't meet the condition, then it will return a  FALSE  message. However, you can decide to specify what you want it to be filled in with, and write this into the function as well. Here is how it looks:

=IF ([the condition], [what we want to display if the condition is met], [what we want to display if it’s not met])

Let’s see it in action!

Use IFERROR

The great thing about the IF function is that once you are familiar with it, you can tweak it, combining it with other words, so it can do more.

IFERROR()  helps you provide an elegant solution to the errors you have in your spreadsheet. The benefit here is to replace the ugly  #N/A  with something more informative like  “ “  for a blank cell, or a prettier  “N/A” (or whatever is more meaningful for you).

Check out this screencast to see how we handle the error messages:

Let’s recap!

  • The IF function allows you to compare what’s in a cell and what you expect, and then returns a result.

  • If the cell doesn't meet the condition you specified, then it will return with  FALSE.

  • You can specify what you want it to be filled in with, and write this into the function as well.

  • Once you are familiar with the IF function, you can tweak it, combining it with other words, so it can do more.

  • IFERROR helps you provide an elegant solution to the errors you have in your spreadsheet.

Now that we’ve covered the IF function, it’s time to move on to another powerful function in spreadsheets; VLOOKUP which helps you match up similar data quickly.

Exemple de certificat de réussite
Exemple de certificat de réussite