I have a calculated value (in column H) which gives the number of trailing 0
s I'd like to trim from the right of a cell (column E). But I only want to remove 0
s; if there are other characters they should remain.
Examples:
E | H | Output
--+---------+--------
3 | 0110A00 | 0110A
3 | 0110A0B | 0110A0B
1 | 0110A00 | 0110A0
Any ideas? I'd like to avoid macros or masses of nested IF
s if possible.
Use:
=LEFT(H1,MAX(AGGREGATE(14,6,ROW(INDEX(A:A,1):INDEX(A:A,LEN(H1)))/(MID(H1,ROW(INDEX(A:A,1):INDEX(A:A,LEN(H1))),1)<>"0"),1),LEN(H1)-E1))