Vai al contenuto
GridBelt
  • Test Excel
  • Esercizi
  • Programmi
  • Prezzi
Accedi
Inizia il test gratuito
  • Test Excel
  • Esercizi
  • Programmi
  • Prezzi
AccediCrea un account
Inizia il test gratuito
GridBelt

Esercitati con Excel nel tuo browser.

Test Excel

  • Livello 1: Principiante
  • Livello 2: Intermedio
  • Livello 3: Esperto
  • Test Excel in 7 giorni
  • Classifica
  • Test Excel per il colloquio
  • Valutazione Excel di Indeed

Esercizi

  • Tutti gli esercizi
  • Programmi
  • Per principianti

Guide

  • Formule Excel
  • Scorciatoie Excel

Azienda

  • Chi siamo
  • Prezzi
  • Come valutiamo

© GridBelt. Tutti i diritti riservati.

  • Informativa sulla privacy
  • Termini di utilizzo
  • Politica di rimborso

Excel è un marchio di Microsoft Corporation. Indeed, TestGorilla, SHL e gli altri marchi appartengono ai rispettivi proprietari. GridBelt è un sito di esercitazione indipendente e non è affiliato a Microsoft, TestGorilla, SHL o Indeed, né approvato o sponsorizzato da queste società.

  1. Esercizi
  2. /
  3. INDEX and MATCH

Last order date per customer: MAXIFS or XLOOKUP from the last row

  • Esperto
  • ~10 min
  • INDEX and MATCH

Testo dell’esercizio in inglese

The Orders sheet holds 400 orders placed in 2026, sorted by date with the oldest first; each row has the order date in column B and the customer in column C. Sales wants a churn watch-list on the Customers sheet: for each of the 30 accounts, the date of its most recent order. A plain lookup returns the first match, which here is the oldest order. You need the last one — either the latest date among that customer's orders, or the last matching row.

Cosa devi fare

  1. 1On Customers, click C2. Option A (any Excel since 2019): =MAXIFS(Orders!$B$2:$B$401,Orders!$C$2:$C$401,A2) — the largest date among the rows whose customer is A2.
  2. 2Option B (Excel 365): =XLOOKUP(A2,Orders!$C$2:$C$401,Orders!$B$2:$B$401,,0,-1) — the 6th argument −1 searches from the last row upwards, so the first hit is the most recent order because the sheet is sorted by date.
  3. 3Click the Orders tab while typing to get the Orders! prefix, lock the ranges with F4 (Windows) or ⌘T (Mac), press Enter and fill C2 down to C31.
  4. 4Column C is pre-formatted as a date. If you see a number like 46333, the result is right — it is a date serial; apply a date format (Ctrl+1 / ⌘1) to any cell that shows one.

Celle di risposta

Correzione

Scrivi la formula nella griglia, premi Enter, poi Verifica. Valutiamo il valore in ogni cella di risposta e la formula che lo produce.

Attività

  1. Non verificatoOn the Customers sheet, in C2, return the most recent order date of the customer in A2 from the Orders sheet (dates in B2:B401, customers in C2:C401) — MAXIFS or XLOOKUP searching from the last row — then fill down to C31.

Consigliato il computer per le attività sul foglio di calcolo. Il foglio scorre all’interno di questo riquadro.

StartInsertFormulasDataView
A1fxPreparazione della cartella di lavoro…
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

Inserisci la formula nel foglio, poi verifica.

Informazioni sull’esercizio

Un set di dati di 430 righe su 2 fogli, una cella di risposta, circa 10 minuti. Correzione nel tuo browser: il valore e la formula che lo produce, con indicazioni su cosa sistemare.

Come risolverlo

  • Customers!C2=MAXIFS(Orders!$B$2:$B$401,Orders!$C$2:$C$401,A2)

Excel stores a date as a serial number — the count of days since 1 January 1900 — so "the most recent date" is simply the largest number. MAXIFS(dates, customers, A2) takes the maximum of the dates on rows whose customer equals the name in A2, which is the last order whatever the sort order of the sheet. XLOOKUP with search mode −1 reaches the same cell differently: it scans the customer column from the bottom and returns the date of the first match it meets, which is the latest order only because the Orders sheet is sorted oldest-first.

Pitfall 1: XLOOKUP(…,-1) depends on the sort order; a sheet sorted by order ID or by customer breaks it silently, MAXIFS does not care. Pitfall 2: MAXIFS returns 0 for a customer with no orders, which a date format shows as 1900-01-00; XLOOKUP returns #N/A. Wrap either in IF or IFNA when the list can contain prospects. Pitfall 3: the result is a serial number until the cell carries a date format — the grader compares numbers, so an unformatted correct answer still passes, but the report reader will not understand 46,250. Pre-2019 alternatives: =MAX(IF(Orders!$C$2:$C$401=A2,Orders!$B$2:$B$401)) entered with Ctrl+Shift+Enter, =LOOKUP(2,1/(Orders!$C$2:$C$401=A2),Orders!$B$2:$B$401) (the classic "last match" trick, sort-order dependent) and =AGGREGATE(14,6,Orders!$B$2:$B$401/(Orders!$C$2:$C$401=A2),1). Performance: MAXIFS scans 400 rows for each of 30 customers — trivial; on a million-row log a pivot table with Max of Order date is the better tool.

Altri metodi validi

  • =XLOOKUP(A2,Orders!$C$2:$C$401,Orders!$B$2:$B$401,,0,-1) — Excel 365; search mode −1 = last to first, relies on the date sort
  • =MAX(IF(Orders!$C$2:$C$401=A2,Orders!$B$2:$B$401)) — array formula (Ctrl+Shift+Enter before Excel 365)
  • =LOOKUP(2,1/(Orders!$C$2:$C$401=A2),Orders!$B$2:$B$401) — the classic last-match trick; also sort-order dependent
  • =AGGREGATE(14,6,Orders!$B$2:$B$401/(Orders!$C$2:$C$401=A2),1) — LARGE(…,1) ignoring the errors produced by non-matching rows

Errori comuni

A plain lookup: =XLOOKUP(A2,Orders!$C$2:$C$401,Orders!$B$2:$B$401) or a VLOOKUP returns the first matching row, which on a sheet sorted oldest-first is the customer's earliest order of the year, not the last.

Come valutiamo

È accettata qualsiasi formula che produce il risultato giusto, a meno che l’attività non indichi una funzione: in quel caso un’altra funzione vale metà dei punti. Confrontiamo i valori con una piccola tolleranza e ignoriamo maiuscole, minuscole e spazi nel testo. Un numero corretto digitato a mano invece di una formula vale metà dei punti. Le attività su più celle valgono il punteggio pieno con il 100% delle celle giuste, metà dei punti dal 50%. Dove serve, cambiamo anche una cella di input su una copia del tuo foglio e controlliamo che la formula si aggiorni.

Risposte calcolate con le regole di Excel 365 e verificate nel nostro correttore in data 16 novembre 2026. Autore: GridBelt team.

In questi programmi

  • Excel for Data AnalystsGiorno 10
  • Excel for Sales and MarketingGiorno 9

Esercizi correlati

  • INDEX and MATCH exact lookupIntermedio, ~6 min
  • Two-way lookup in a matrixEsperto, ~8 min
  • Two-criteria lookup (product and region)Esperto, ~10 min
  • Replace VLOOKUP with XLOOKUPIntermedio, ~6 min

Guida alla funzione

Documentazione ufficiale

Esercizio successivo

Full name with CONCAT or &