
First you take the equation I have. Lets use a real example. I will take four speeds and do the equation for them, then post the last line of their turns to show the turn order. (It doesn't matter if they are on a team or not the order will be the same.)
Speed
Ninja A - 200; Ninja B - 320; Ninja C - 440; Ninja D - 240
Speed Percentile
Ninja A - 100
Ninja B - 63
Ninja C - 46
Ninja D - 84
Now we will start the turns, starting at turn one.
Ninja C
Speed Percentile: 46
Turn Order: 92
Ninja B
Speed Percentile: 63
Turn Order: 126
Ninja D
Speed Percentile: 84
Turn Order: 168
Ninja C
Speed Percentile: 46
Turn Order: 138
Ninja A
Speed Percentile: 100
Turn Order: 200
Ninja B
Speed Percentile: 63
Turn Order: 189
Ninja C
Speed Percentile: 46
Turn Order: 184
Ninja D
Speed Percentile: 84
Turn Order: 252
Ninja C
Speed Percentile: 46
Turn Order: 230
Ninja B
Speed Percentile: 63
Turn Order: 252
Ninja A
Speed Percentile: 100
Turn Order: 300
~As you can see, the person with the lowest Turn Order is the one who is up next in each case.

The turn order after turn one is what is important. It allows for irregular stacking of turns. If you imagine each person's turn to be a size of block, people with higher speeds having smaller blocks. If you stack these blocks into a tower next to each other, the top of each block would be when each person starts their turn.
Now as you can see, the black lines of the bar represent when the ninja takes a turn, starting at the bottom would be the first turn. Because Ninja A's blocks are smaller, they sometimes stack multiple times before Ninja B's single block. Sometimes resulting in one turn before his, and sometimes two, depending on his it falls. This is how Turn Order works.