Hello,
I recently started Excel and to learn it I challenged myself to make a game.
The game is a turn-based strategy with actors using their speed value to know in what order they should play during the current turn.
The problem I'm trying to solve right now is the edge case of speed ties; multiple actors sharing the same speed value.
I currently have a first table where I store the final sum of each speed value per actors, I called that specific part of the table Speed_Used.
My 4 actors are grouped under the name Math_Targets.
Next to it, I have a second table with 4 positions (4 cells).
Here I store the speed values from highest to lowest like this (grouped under the name SpeedPositions_Numbers):
P1: =MAX(Speed_Used)
P2: =LARGE(Speed_Used,2)
P3: =LARGE(Speed_Used,3)
P4: =MIN(Speed_Used)
Right under this, I'm placing my actors' name below their speed value with this formula =XLOOKUP(SpeedPositions_Numbers,Speed_Used,Math_Targets).
So in the context of a speed tie, I'm getting the first actor's name that match with the speed value multiple times.
I read and tried a bunch of stuff, like: TEXTJOIN, COUNTIF, INDEX, MATCH, but so far I didn't managed to solve my problem on my own.
I'm not looking for the most fair play game design wise solution (but I also don't want to hack it); right now I would be happy if I could simply get the next valid name in line to take place in my position table.
Any help would be appreciated.
Thank you.
Bookmarks