求大神指教一个批量替换的问题
A1/B1*A1/B1*A4/B1*A7/B1*A7/B1 A1/B1*(A1-1)/(B1-1)*A4/(B1-2)*A7/(B1-3)*(A7-1)/(B1-4)A2/B1*A5/B1*A5/B1*A8/B1*A9/B1 A2/B1*A5/(B1-1)*(A5-1)/(B1-2)*A8/(B1-3)*A9/(B1-4)
A1/B1*A2/B1*A3/B1*A3/B1*A3/B1 A1/B1*A2/(B1-1)*A3/(B1-2)*(A3-1)/(B1-3)*(A3-2)/(B1-4)
如何把左边的公式批量替换成右边的(同一个值出现2次则-1,出现3次则-2,以此类推)