I'm tracking season results of the Premier League in an Excel spreadsheet and I would like to implement a way to show each team's form (the result of their last 5 games). This seems to be very difficult in Excel for some reason or another.
My idea is to create an array of all results from games involving the team, then display the last 5 items in the array elsewhere in the sheet. In python for example, I could index the array by doing array[-1]
, but I can't find any equivalent in Excel (doesn't help that "index" is a whole different function in Excel, making Googling this topic very difficult).
TL;DR is there an Excel equivalent (on Excel's arrays) for Python's array[-1]
?
EDIT: Say I come up with a formula that results in the array {"Win", "Win", "Win", "Lose", "Draw", "Lose", "Win", "Draw"} (lets call this array 'form'), is there a way to get the last ("Draw"), second last ("Win"), third last ("Loss") etc. value from this array in Excel? Again using Python as an example, this would be done like form[-1], form[-2], form[-3]
etc.
Say I want to look at Spurs' form for their last 2 games (let's pretend these 3 games are all they have played). My approach would be to use an array formula to store the 'Result' value in column I in an array from every row containing the value 'Spurs' (found in rows 10, 20, 33 for reference) (still working on the specifics of this part too). So then that array formula would evaluate to {"Spurs", "Draw", "Newcastle United"}. In a different cell I would then like to take the 3rd value of this array ("Newcastle United), and in the next cell I'd like the 2nd value of the array ("Draw") etc. etc.