First time posting so I hope I'm getting it right. I have a complicated spreadsheet for which I'm going to describe a simplified version here, in order to illustrate a challenge I'm having.
Imagine we have rows 1 to 5 and columns A to F
Column D is always some ratio of columns A, B, and C in the same row.
So D1 can be A1/B1 or A1/C1 or B1/A1 or B1/C1 or......etc.
Likewise D2 can be A2/B2 or A2/C2 or.....etc.
Column E displays the formula from column D. I used "FORMULATEXT" or alternatively a VBA I found on this forum called ShowF
<code class="vb keyword">Function</code> <code class="vb plain">ShowF(Rng </code><code class="vb keyword">As</code> <code class="vb plain">Range)</code>
<code class="vb plain">ShowF = Rng.Formula</code>
<code class="vb keyword">End</code> <code class="vb keyword">Function</code>
So the cells in column E are text values like A3/B3 or B15/C15
I'd like to create column F so that I am only getting the ratio without the row numbers included. So I'd like F1 to display A/B or B/C or B/A, etc....
The problem with SUBSTITUTE or REPLACE is that the parameter, like "A3", is in quotes, so it doesn't become "A4" when I drag it down to the next row. It remains "A3" when I try to drag it down to the next row.
Is there some kind of nested function or a VBA script that would be able to achieve this?
Thanks in advance!
Imagine we have rows 1 to 5 and columns A to F
Column D is always some ratio of columns A, B, and C in the same row.
So D1 can be A1/B1 or A1/C1 or B1/A1 or B1/C1 or......etc.
Likewise D2 can be A2/B2 or A2/C2 or.....etc.
Column E displays the formula from column D. I used "FORMULATEXT" or alternatively a VBA I found on this forum called ShowF
<code class="vb keyword">Function</code> <code class="vb plain">ShowF(Rng </code><code class="vb keyword">As</code> <code class="vb plain">Range)</code>
<code class="vb plain">ShowF = Rng.Formula</code>
<code class="vb keyword">End</code> <code class="vb keyword">Function</code>
So the cells in column E are text values like A3/B3 or B15/C15
I'd like to create column F so that I am only getting the ratio without the row numbers included. So I'd like F1 to display A/B or B/C or B/A, etc....
The problem with SUBSTITUTE or REPLACE is that the parameter, like "A3", is in quotes, so it doesn't become "A4" when I drag it down to the next row. It remains "A3" when I try to drag it down to the next row.
Is there some kind of nested function or a VBA script that would be able to achieve this?
Thanks in advance!