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. FILTER, SORT and UNIQUE

FILTER function practice: orders over $1,000 in West, counted and totalled

  • Expert
  • ~10 min
  • FILTER, SORT and UNIQUE
  • Excel 365

Énoncé en anglais

The order log for July–October 2026 holds 300 orders from five regions in A2:E301. The West regional director wants a live list of her large orders — every order over the amount in H3, all five columns — plus how many there are and what they add up to, and she wants to change the region in H2 or the amount in H3 and see everything follow. The Region column was typed by hand: 28 rows differ from the standard spelling only by letter case or a trailing space ("west", "WEST", "West "), and 73 orders belong to West once you read them that way. One West order is exactly $1,000.00 — not over it.

Ce que vous devez faire

  1. 1Click J2 and start the formula: =FILTER(A2:E301, — the first argument is the whole order table, all five columns.
  2. 2Build the include argument as two tests multiplied together: (TRIM(C2:C301)=H2)*(E2:E301>H3). TRIM strips the stray spaces before the comparison, the comparison itself ignores letter case, and > (not >=) leaves out the order of exactly $1,000.00.
  3. 3Add the third argument so an empty result reads as text instead of #CALC!: ..., "No orders") and press Enter. The matching orders spill into J2:N52 on their own — keep those cells empty, or Excel shows #SPILL!.
  4. 4Click H4 and count the matches with the same test: =ROWS(FILTER(A2:A301,(TRIM(C2:C301)=H2)*(E2:E301>H3))), or =SUMPRODUCT((TRIM(C2:C301)=H2)*(E2:E301>H3)).
  5. 5Click H5 and add them up: =SUM(FILTER(E2:E301,(TRIM(C2:C301)=H2)*(E2:E301>H3))).
  6. 6Test it: type 5000 in H3 or North in H2 and watch the list, the count and the total change (Ctrl+Z / ⌘Z undoes the edit). Put West and 1000 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 J2, use FILTER to list every order (all columns A:E) whose region matches H2 — compared after TRIM — and whose amount is over the amount in H3; return "No orders" when nothing matches. The list spills across J:N.
  2. Non vérifiéIn H4, count how many orders match the region in H2 (trimmed) and are over the amount in H3 — for example ROWS around a FILTER, or SUMPRODUCT over the same two tests.
  3. Non vérifiéIn H5, add up the amounts of those same orders — SUM around a FILTER of column E, or SUMPRODUCT.

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 300 lignes sur une feuille, 3 cellules de réponse, environ 10 minutes. Corrigé dans votre navigateur : la valeur et la formule qui la produit, avec des indications sur la correction à apporter.

Comment le résoudre

  • J2=FILTER(A2:E301,(TRIM(C2:C301)=H2)*(E2:E301>H3),"No orders")
  • H4=ROWS(FILTER(A2:A301,(TRIM(C2:C301)=H2)*(E2:E301>H3)))
  • H5=SUM(FILTER(E2:E301,(TRIM(C2:C301)=H2)*(E2:E301>H3)))

FILTER keeps the rows of A2:E301 for which the include argument is TRUE. Two conditions are combined by multiplying them: TRUE*TRUE is 1, anything else is 0, so (TRIM(C2:C301)=H2)*(E2:E301>H3) is an AND that works across a whole column at once. TRIM matters because "West " with a trailing space is not equal to "West" — and the first large West order in this log is typed exactly like that — while > keeps the $1,000.00 order out, because it is not over $1,000. The optional third argument replaces the #CALC! error with "No orders" when nothing qualifies, and ROWS and SUM around the same FILTER give the count and the total.

Pitfall 1: text comparisons in Excel ignore case but not spaces; TRIM also collapses double spaces inside a name, while CLEAN removes the non-printing characters that copy-pastes bring along. Pitfall 2: use * for AND and + for OR between array conditions; AND() and OR() collapse the arrays to a single TRUE/FALSE and FILTER then returns everything or nothing. Pitfall 3: ROWS(FILTER(...,"No orders")) returns 1 for an empty result because the fallback text is a 1×1 array — count with a FILTER that has no fallback, or with SUMPRODUCT((TRIM(C2:C301)=H2)*(E2:E301>H3)), which returns 0. Alternatives: SUMPRODUCT handles the count, and SUMPRODUCT((TRIM(C2:C301)=H2)*(E2:E301>H3),E2:E301) the total, in Excel 2019; COUNTIFS and SUMIFS are faster on very large tables but cannot TRIM the criteria range, so they miss the 3 rows typed "West " here — clean the column first. Layout: a spilled list grows and shrinks, so never put anything below or to the right of its anchor; SORT(FILTER(...),5,-1) sorts the result by amount, and CHOOSECOLS(FILTER(...),1,5) returns only the columns you need. Version note: FILTER and SORT need Excel 365 or Excel 2021 (CHOOSECOLS: Excel 365); in Excel 2019 the equivalent is an AutoFilter plus SUBTOTAL, or Advanced Filter for a static copy.

Autres méthodes valables

  • =SUMPRODUCT((TRIM(C2:C301)=H2)*(E2:E301>H3)) — the count without FILTER (works in Excel 2019)
  • =SUMPRODUCT((TRIM(C2:C301)=H2)*(E2:E301>H3),E2:E301) — the total without FILTER
  • =FILTER(A2:E301,(TRIM(C2:C301)=H2)*(E2:E301>H3)) — the same list without the fallback; shows #CALC! when nothing matches
  • =SORT(FILTER(A2:E301,(TRIM(C2:C301)=H2)*(E2:E301>H3),"No orders"),5,-1) — largest order first (a different order, so not for this check)

Erreurs fréquentes

Comparing the region without TRIM: =FILTER(A2:E301,(C2:C301=H2)*(E2:E301>H3)) skips the 3 matching orders typed "West " — including the very first one, so J2 shows SO-41012 instead of SO-41008 and H4 shows 48 instead of 51.

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 test in 7 days, Plan de niveau 2Jour 6
  • Excel for Data AnalystsJour 11
  • Excel for Sales and MarketingJour 9

Exercices associés

  • List unique customers (UNIQUE) — remove duplicatesIntermédiaire, ~8 min
  • Products ranked by sales with SORTBYExpert, ~8 min
  • Highlight the top 10 % of salesIntermédiaire, ~8 min

Référence de la fonction

Documentation officielle

Exercice suivant

Products ranked by sales with SORTBY