Is the pipe 3" or 4", and what's the subfloor (slab or wood)? Do you have access from underneath if you cut out some ceiling? If the pipe is 4", you can install an inside mount flange, but not if it is 3". If you have access, you can just cut off enough pipe and glue on a new piece the right height to install a new flange. The flange is supposed to be mounted on TOP of the finished floor, but might be tricky if the tile isn't installed to give the edges support.