View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Finding right-most cell.

On Thu, 29 Sep 2011 05:44:41 -0700 (PDT), gcotterl wrote:

Each row has one and that cell has 1,274 characters.

My question simplified: How can I delete the zeroes after the last 9
in each row?



Expanding on my answer from your other thread

=LEFT(A1,LOOKUP(2,1/(MID(A1,ROW(INDIRECT("1:1274")),1)="9"),ROW(INDIRE CT("1:1274"))))

should do it. The "1274" can be any number at least as long as the longest string, and not greater than the maximum number of rows in your worksheet (e.g. 65536 or 1048576 depending on your version of Excel).

What result do you want if there is no "9" in the string? As written, the above formula will return an error. And what version of Excel are you using?