Quote:
Originally Posted by ghostofbretmaverik
great thread...
I've been working on a little project and automating it would be great...can you write a formula for this OP?
I want to start with the number 196 (A1), I want excel to reverse it (691--> A2) and then compare to A1. If equal (11211 for example) then STOP, and if not equal then continue on and populate B1 with the sum (887).
Then the procedure repeats for b1 (887) reverse it (788-->b2), Sum it and populate C1. Compare and stop if equal, continue if not.
I need to do it this way rather than a simple script because I need a report of the progress.
I think both of the last answers misinterpreted what you were asking for, but if you copy zomg's reverseNumber function into a module, you can write this in cell B1:
Code:
=IF(ISERR(VALUE(A1)),"",IF(VALUE(A1)=VALUE(A2),"",A1+A2))
And this in cell A2:
Then drag-copy those formulas across through as many cells as required. Once you get near column Z if a match hasn't been found yet you'll get an error due to the numbers being too large. So you probably don't need to drag further than that, but if you do, you'll need a much more complex formula to continue calculating.