Return the last N active records
Your goal: Skip empty-ID slots, reorder the fields and take the final requested records without sorting or reversing them.
Full task requirements
Enter one formula in G5. Use the eight source slots A2:D9 in their existing oldest-to-newest order. A slot is active when its ID in column A is nonempty. Return the last F2 active records as ID, Units and Team, with no headings, preserving their original relative order. Retain duplicate IDs, numeric zero and signed units. If F2 exceeds the active count, return every active record. If none are active, return No records in one cell. F2 must be a numeric integer from 1 through 8.
Last three active records skip interior empty-ID slotsRemove only empty-ID slots
Recent count · F2: 3
| # | ||||
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 | ||||
| 8 | ||||
| 9 |
Step 1 of 2
Remove only empty-ID slots
Rules for this step
Choose every active physical record in A2:A9. Repeated IDs are separate records; zero and negative units stay active.