1. Extract Ticket IDs and Assigned Agents
| Ticket ID | Priority | Opened | Closed | Agent | CSAT |
| 101 | High | 2023-09-01 | 2023-09-02 | Alice | 5 |
=MAKEARRAY(ROWS(Tickets!A2:A6),2,LAMBDA(r,c,IF(c=1,INDEX(Tickets!A2:A6,r,1),INDEX(Tickets!E2:E6,r,1))))
Result: 101Alice102Bob103Alice104Charlie105Bob
The lambda receives a row number (r) and a column selector (c). When c equals 1 it pulls the Ticket ID from column A; otherwise it pulls the Agent name from column E. MAKEARRAY repeats this logic for each of the five data rows, producing a two-column array that pairs each ticket with its owner.
2. Calculate Resolution Time in Days
| Ticket ID | Priority | Opened | Closed | Agent | CSAT |
| 101 | High | 2023-09-01 | 2023-09-02 | Alice | 5 |
=MAKEARRAY(ROWS(Tickets!C2:C6),1,LAMBDA(r,c,DATEDIF(INDEX(Tickets!C2:C6,r,1),INDEX(Tickets!D2:D6,r,1),"d")))
Result: 14122
Here the lambda calculates the difference in days between the Opened (column C) and Closed (column D) dates for each row using DATEDIF. Because the column count is set to 1, MAKEARRAY returns a single-column vertical array where each element is the ticket's resolution time. The numbers line up with the sample data: ticket 101 closed in one day, ticket 102 took four days, and so on.
3. Average CSAT by Priority
| Ticket ID | Priority | Opened | Closed | Agent | CSAT |
| 101 | High | 2023-09-01 | 2023-09-02 | Alice | 5 |
=MAKEARRAY(3,2,LAMBDA(r,c,IF(c=1,CHOOSE(r,"High","Medium","Low"),AVERAGEIFS(Tickets!F2:F6,Tickets!B2:B6,CHOOSE(r,"High","Medium","Low")))))
Result: High4Medium3Low4.5
The lambda builds a 3-row by 2-column table. Column 1 uses CHOOSE to emit the three priority labels in order. Column 2 calculates the average CSAT for each priority with AVERAGEIFS, pulling CSAT scores from column F and matching the current priority label. The final matrix shows that High-priority tickets average a CSAT of 4, Medium a 3, and Low a 4.5.