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. INDEX and MATCH

INDEX MATCH practice: pull the hourly rate for every timesheet entry

  • Intermédiaire
  • ~6 min
  • INDEX and MATCH

Énoncé en anglais

Payroll receives 100 weekly timesheet entries for October 2026 — four weeks for 25 hourly employees — with the employee ID in column C and the hours in column D. The hourly rates live on the Staff sheet (ID, name, department, hourly rate), in roster order rather than sorted. Pull the rate for every entry with INDEX and MATCH: MATCH finds the position of the ID in the Staff list, INDEX returns the rate at that position.

Ce que vous devez faire

  1. 1On Timesheet, click E2 and start from the inside: MATCH(C2,Staff!$A$2:$A$26,0) returns the row position of this employee's ID in the Staff list (0 = exact match). Click the Staff tab and select the column; F4 / ⌘T locks it.
  2. 2Wrap it in INDEX: =INDEX(Staff!$D$2:$D$26,MATCH(C2,Staff!$A$2:$A$26,0)) — INDEX returns the cell of the rate column at that position. Press Enter.
  3. 3Fill E2 down to E101. Both Staff ranges must stay locked; only C2 moves.
  4. 4Check that the rate column (D) and the ID column (A) in your formula cover exactly the same rows — INDEX and MATCH count positions, so an offset of one row returns the wrong employee's rate.

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éOn the Timesheet sheet, in E2, use INDEX and MATCH to return the hourly rate (Staff column D) of the employee ID in C2, matching against the Employee ID column of the Staff sheet, then fill down to E101.

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 125 lignes sur 2 feuilles, une cellule de réponse, environ 6 minutes. Corrigé dans votre navigateur : la valeur et la formule qui la produit, avec des indications sur la correction à apporter.

Comment le résoudre

  • Timesheet!E2=INDEX(Staff!$D$2:$D$26,MATCH(C2,Staff!$A$2:$A$26,0))

MATCH(C2,Staff!A2:A26,0) answers "which row of the ID list holds this ID?" with a position — a 1 for the first employee, 25 for the last — and the 0 insists on an exact match. INDEX(Staff!D2:D26, position) then returns the cell of the rate column at that same position. The two functions split the lookup into "find the row" and "read the column", which is why the rate column can be anywhere — left, right or on another sheet — and why inserting a column in Staff never breaks the formula.

Pitfall 1: the INDEX range and the MATCH range must be aligned — Staff!D1:D26 with Staff!A2:A26 is off by one and returns the previous employee's rate for everyone, with no error to warn you. Pitfall 2: leaving out the 0 in MATCH switches to approximate match; on this unsorted roster that returns wrong positions silently. Pitfall 3: MATCH returns #N/A when the ID is missing; wrap the whole INDEX in IFERROR or IFNA when the timesheet can contain IDs of leavers. INDEX/MATCH vs VLOOKUP: same result as =VLOOKUP(C2,Staff!$A$2:$D$26,4,FALSE) here, but INDEX/MATCH looks left, survives inserted columns, and on big tables a single MATCH can feed several INDEX formulas (rate, department, name) instead of repeating the search. In Excel 365, =XLOOKUP(C2,Staff!$A$2:$A$26,Staff!$D$2:$D$26) is the one-function replacement; INDEX/MATCH remains the form that opens in every Excel version and in most other spreadsheet tools.

Autres méthodes valables

  • =INDEX(Staff!$A$2:$D$26,MATCH(C2,Staff!$A$2:$A$26,0),4) — INDEX over the whole table with a column number
  • =IFERROR(INDEX(Staff!$D$2:$D$26,MATCH(C2,Staff!$A$2:$A$26,0)),"Unknown ID") — with a fallback for IDs that are not on the roster
  • =XLOOKUP(C2,Staff!$A$2:$A$26,Staff!$D$2:$D$26) — Excel 365 equivalent (not accepted here: this task practices INDEX and MATCH)

Erreurs fréquentes

Swapping the roles: =MATCH(C2,Staff!$D$2:$D$26,0) or =INDEX(Staff!$A$2:$A$26,…) — MATCH must search the column that contains the key (IDs), INDEX must return from the column you want (rates).

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 2
  • Excel for Data AnalystsJour 4
  • Excel for Sales and MarketingJour 4

Exercices associés

  • Two-way lookup in a matrixExpert, ~8 min
  • Last order date per customerExpert, ~10 min
  • Pull the unit price with VLOOKUP (exact match)Débutant, ~5 min
  • Look left: employee ID by emailExpert, ~6 min

Référence de la fonction

Documentation officielle

Exercice suivant

Two-way lookup in a matrix