Vba for replacement of cell vulue in fractional suffix
I wish to have a vba like : In an Excel sheet,
a) In a row , say 1 & at any col.say 'A' , the cell content is P1; at cell B1, the cell value is 1,at cell C1, the cell value is 1 & so on till it is other than 1, may be q or any other data.
b) likewise in other col.&row say B3 , the cell content is NP1/4; at cell C3(i.e., offset each col. horizontally) , the cell value is 1,at cell D3, the cell value is 1,the cell value at E3 is 1 & so on till it is other than 1, may be q or any other data.
The result needed is that for a)
the cell value at A1 i.e., P1 will be replaced as P3 ( the arithmetic sum of 1 of P1 and 1-each for occurrence of each adjacent horizontal right cell.
Similarly, for b) above,
the cell value at B3 will be replaced as NP13/4 ( i.e., 1/4+1+1+1).
Kindly, note that the fractional part of the mother cell would in 1/2,1/4,1/8,1/16 etc. and the result to be expressed in fraction and they would appear as suffix.