In this article we study b → sμ+μ− transitions and possible correlations with the anomalous magnetic moment of the muon (aμ) within two-Higgs-doublet models with generic Yukawa couplings, including the possibility of right-handed neutrinos. We perform the matching on the relevant effective Hamiltonian and calculate the leading one-loop effects for b → sℓℓ(′), b → sγ, ΔB = ΔS = 2, b→sνv¯¯¯ and ℓ → ℓ′γ transitions in a general Rξ gauge. Concerning the phenomenology, we find that an explanation of the hints for new physics in b → sμ+μ− data is possible once right-handed neutrinos are included. If lepton flavour violating couplings are allowed, one can account for the discrepancy in aμ as well. However, only a small portion of parameter space gives a good fit to b → sμ+μ− data and the current bound on h → τμ requires the mixing between the neutral Higgses to be very small if one aims at an explanation of aμ.