For a one-parameter family of lower triangular matrices with entries involving continuous qultraspherical polynomials we give an explicit lower triangular inverse matrix, with entries involving again continuous q-ultraspherical functions. The matrices are q-analogues of results given by Cagliero and Koornwinder recently. The proofs are not q-analogues of the Cagliero-Koornwinder case, but are of a different nature involving q-Racah polynomials. Some applications of these new formulas are given. Also the limit β → 0 is studied and gives rise to continuous q-Hermite polynomials for 0 < q < 1 and q > 1.