There is a question here concerning expansion of the universe, and a comparison with the Andromeda galaxy which is indeed moving towards our galaxy. So let us start with the basics. I will outline the understanding of cosmology as currently understood.
Let the distance to some galaxy far away be x. I find that this distance x is changing, so I assign a scale factor a. So the time evolution of a distance x is given by
x = x(t) = a(t)x(0)
In this way this motion of any distant galaxy can be compared to this scale factor which expands (or contracts if that were to be the case) with the dynamics of the universe.
Now consider the next ingredient. The energy E of a particle of mass m moving in a central gravity field by some mass M at a distance r is
E = (1/2)mv^2 - GMm/r
The total energy E is constant, and largely can be ignored. In particular if the universe expands so there is no recollapse we can set it to zero. We concentrate on the velocity
v = dx/dt = x(0)(da/dt) = x(0)a', prime means time derivative,
so that (1/2)mv^2 = (1/2)(a')^2(x(0))^2. Now concentrate on the gravity part. We set r = x, the distance to other galaxies, and we assign an average density so that the mass M is a sum of all these galactic masses M = ρVol. The volume out to some radial distance x is then Vol = (4π/3)x^3 = (4π/3)a^3(x(0))^3. We put all of this together and we get the equation
(a'/a)^2 = 8πGρ/3.
This equation is close to what one gets with general relativity, where here we have just used Newtonian mechanics and gravity. There is with general relativity an additional -k/a^2 factor related to the constant energy E, which for a spatially flat universe has k = 0.
How the Hubble constant is H = (a'/a), which is a constant in space, but not necessarily in time. The Einstein cosmological constant is Λ = 8πGρ for some constant vacuum energy density ρ, and so the Hubble parameter is then
H^2 = (a'/a)^2 = Λ/3
For some other mass-energy density, such as matter or radiation, the density is dependent on the scale factor a.
For those familiar with differential equations the solution to a' = sqrt{Λ/3}a is an exponential function. This is the expansion driven universe we do observe. For a small scale factor this exponential is approximately linear a' ~= (1 + sqrt{Λ/3})a which gives the Hubble relation found in the 1920s v = Hd. So for a galaxy as a distance d the Hubble parameter multiplied by that distance gives the velocity. The Hubble parameter is approximately H = 74km/sec/Mpc.
The red shift factor z = v/c, which by the Hubble law is z = Hd/c. This is an approximation, where H should be thought of as the Hubble parameter that is constant on the spatial surface of the Hubble frame. The distance is d = c/H = 3x10^{5}km/sec/74km/sec/Mpc = 4054Mpc or 1.3x10^{10}ly. The apparent magnitude of an object is m = M + 5(log_{10}d - 1), for M the absolute magnitude and d the distance. For objects at z = 1 the Hubble distance matches the luminosity distance d = 10^{(m-M)5+1}. In fact this works out to the most distant galaxies observed out to z = 10.
This does mean that objects are commoving with expanding space faster than light. It does turn out that we can still receive photons from them. Explaining that is for another day. The CMB limit is out to z = 1100, and the luminosity matches a distance of 46 billion light years. How this is larger than the distance conversion to 13.7 billion years is due to the dynamics of space.
Cheers LC