google-sheetsspreadsheethexagonal-tiles

Calculate the number of hexes between two hexes on a hex grid?


enter image description here

Using the hexgrid and coordinates above, I am trying to find a consistent formula to calculate the distance between two hexes.


Solution

  • Switched from my x,y to q,r,s coordinates by

    q=x
    r=y-(x+(ISODD(x)))/2
    s=-r-q
    

    then used this formula:

    =max(abs(q1-q2) + abs(r1-r2) + abs(s1-s2)) / 2
    

    hopefully this helps someone using an even-q grid