Aller au contenu
GridBelt
  • Test Excel
  • Exercices
  • Programmes
  • Tarifs
Se connecter
Commencer le test gratuit
  • Test Excel
  • Exercices
  • Programmes
  • Tarifs
Se connecterCréer un compte
Commencer le test gratuit
GridBelt

Entraînez-vous sur Excel dans votre navigateur.

Test Excel

  • Niveau 1 : Débutant
  • Niveau 2 : Intermédiaire
  • Niveau 3 : Expert
  • Test Excel en 7 jours
  • Classement
  • Test Excel en entretien d’embauche
  • Évaluation Excel d’Indeed

Exercices

  • Tous les exercices
  • Programmes
  • Pour débutants

Guides

  • Formules Excel
  • Raccourcis Excel

Entreprise

  • À propos
  • Tarifs
  • Comment nous corrigeons

© GridBelt. Tous droits réservés.

  • Politique de confidentialité
  • Conditions d’utilisation
  • Politique de remboursement

Excel est une marque commerciale de Microsoft Corporation. Indeed, TestGorilla, SHL et les autres marques sont la propriété de leurs détenteurs respectifs. GridBelt est un site d’entraînement indépendant ; il n’est affilié ni à Microsoft, ni à TestGorilla, ni à SHL, ni à Indeed, et n’est ni cautionné ni sponsorisé par ces sociétés.

  1. Exercices
  2. /
  3. Conditional formatting

Conditional formatting practice: highlight the top 10% of store sales

  • Intermédiaire
  • ~8 min
  • Conditional formatting

Énoncé en anglais

A retail chain's October 2026 report lists 150 stores with their sales in E2:E151. 140 stores reported a number; 7 were closed for refurbishment and show the text "closed", and 3 have not reported yet. The sales director wants the top 10% of stores (the share is in I2) highlighted for the bonus round. Two stores tie exactly at the cut-off, and both belong in the top group. The highlight will be a conditional-formatting rule; first you build its logic in cells: the cut-off value, a TRUE/FALSE flag per store and the count.

Ce que vous devez faire

  1. 1Click I3 and type =PERCENTILE.INC(E2:E151,1-I2): the sales value that 90% of the reported stores stay below. PERCENTILE.INC skips the "closed" and empty cells by itself.
  2. 2Click F2 and type =AND(ISNUMBER(E2),E2>=$I$3). Press F4 (Windows) or ⌘T (Mac) on I3 to lock it, then fill down to F151 (double-click the fill handle, or select F2:F151 and press Ctrl+D / ⌘D).
  3. 3ISNUMBER matters: Excel ranks any text above every number, so "closed">=$I$3 is TRUE and a plain E2>=$I$3 would flag the closed stores. And >= matters: the two stores that sit exactly on the cut-off belong to the top group.
  4. 4Click I4 and count the flags: =COUNTIF(F2:F151,TRUE).
  5. 5Now apply the built-in rule: select E2:E151, then Home → Conditional Formatting → Top/Bottom Rules → Top 10% (Windows keyboard: Alt, H, L, T; on Mac the same menu path), keep 10, pick a fill and click OK. In Excel this rule colours the same stores as your helper column: it ranks only the numbers and keeps both stores tied at the cut-off. The checker grades the cut-off, the flags and the count, not the colours.
  6. 6Try 20% in I2: the cut-off drops to $176,491 and 28 stores qualify. Put 10% back before you check.

Cellules de réponse

Correction

Saisissez votre formule dans la grille, appuyez sur Enter, puis cliquez sur Vérifier. Nous corrigeons la valeur de chaque cellule de réponse et la formule qui la produit.

Tâches

  1. Non vérifiéIn I3, use PERCENTILE.INC to compute the cut-off for the top share in I2: the (1 − I2) percentile of the sales in E2:E151.
  2. Non vérifiéIn F2, return TRUE when E2 holds a number that is at least the cut-off in I3 and FALSE otherwise ("closed" and empty cells are never in the top group), then fill down to F151.
  3. Non vérifiéIn I4, count the stores in the top group.

Ordinateur recommandé pour les tâches dans la feuille de calcul. La feuille défile à l’intérieur de ce cadre.

StartInsertFormulasDataView
A1fxPréparation de votre classeur…
A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Sheet1

Saisissez votre formule dans la feuille, puis vérifiez.

À propos de cet exercice

Un jeu de données de 150 lignes sur une feuille, 3 cellules de réponse, environ 8 minutes. Corrigé dans votre navigateur : la valeur et la formule qui la produit, avec des indications sur la correction à apporter.

Comment le résoudre

  • I3=PERCENTILE.INC($E$2:$E$151,1-$I$2)
  • F2=AND(ISNUMBER(E2),E2>=$I$3)
  • I4=COUNTIF(F2:F151,TRUE)

PERCENTILE.INC(range, 0.9) returns the value that 90% of the numbers in the range stay below, so every store at or above it is in the top 10%. Writing it as 1-I2 keeps the share in one cell: change I2 and the cut-off, the flags and the count all follow. The flag needs two tests: ISNUMBER(E2), because Excel ranks any text above every number and "closed" would otherwise pass, and E2>=$I$3, because a store exactly on the cut-off belongs to the group — here two stores tie there. Excel's built-in Top 10% rule makes the same decision for the colours: it ranks only the numbers and keeps ties at the cut-off.

Pitfall 1: text in a number column — a comparison such as "closed">=100000 is TRUE in Excel (text sorts after numbers), so a plain E2>=$I$3 flags 7 closed stores; PERCENTILE.INC, LARGE and the built-in rule simply skip text. Pitfall 2: > instead of >= — the cut-off is $200,285, the sales of both tied stores, so > leaves 13 stores instead of 15. Pitfall 3: PERCENTILE.EXC ranks at (n + 1)·p instead of (n − 1)·p + 1 and gives other cut-offs when the share changes; this task follows PERCENTILE.INC (the same as the old PERCENTILE). Alternatives: =IF(ISNUMBER(E2),RANK.EQ(E2,$E$2:$E$151)<=ROUNDDOWN(COUNT($E$2:$E$151)*$I$2,0),FALSE) flags by rank (both tied stores share rank 14) — the IF matters, because AND evaluates every argument and RANK.EQ of "closed" is #VALUE!, which AND passes on. =LARGE($E$2:$E$151,ROUNDDOWN(COUNT($E$2:$E$151)*$I$2,0)) is the cut-off the built-in rule uses — the 14th largest value; when the count of numbers is a multiple of 10 it selects the same stores as PERCENTILE.INC (here it is even the same value, because of the tie). In a formula-based rule the helper is optional: select E2:E151, New Rule → "Use a formula to determine which cells to format" and enter =AND(ISNUMBER($E2),$E2>=$I$3) (Windows: Alt, H, L, N), which also lets you colour the whole row (select A2:F151 instead).

Autres méthodes valables

  • =AND(ISNUMBER(E2),E2>=PERCENTILE.INC($E$2:$E$151,1-$I$2)) — the cut-off inside the flag instead of in I3
  • =PERCENTILE($E$2:$E$151,1-$I$2) — the older name of PERCENTILE.INC, same result
  • =IF(ISNUMBER(E2),E2>=$I$3,FALSE) — the same flag with IF
  • =COUNTIF($E$2:$E$151,">="&$I$3) — counts the top group straight from the sales (COUNTIF skips text for a ">=" criterion)

Erreurs fréquentes

Writing =E2>=$I$3 without ISNUMBER: Excel treats the text "closed" as larger than any number, so rows 40, 42, 56… are flagged TRUE and the count comes out 22 instead of 15.

Comment nous corrigeons

Toute formule qui produit le bon résultat est acceptée, sauf si la tâche nomme une fonction : une autre fonction rapporte alors la moitié des points. Nous comparons les valeurs avec une petite tolérance et ignorons la casse et les espaces dans le texte. Un nombre correct saisi à la main au lieu d’une formule rapporte la moitié des points. Les tâches sur plusieurs cellules rapportent tous les points avec 100 % de cellules justes, la moitié à partir de 50 %. Lorsque c’est pertinent, nous modifions aussi une cellule d’entrée sur une copie de votre feuille et vérifions que votre formule suit.

Réponses calculées selon les règles d’Excel 365 et vérifiées dans notre correcteur le 16 novembre 2026. Auteur : GridBelt team.

Dans ces programmes

  • Excel for Sales and MarketingJour 6

Exercices associés

  • Highlight overdue invoices (conditional formatting)Intermédiaire, ~8 min
  • Products ranked by sales with SORTBYExpert, ~8 min
  • Orders over $1,000 in West with FILTERExpert, ~10 min

Référence de la fonction

Documentation officielle

Exercice suivant

Drop-down list of regions (data validation)