View Single Post
  #6   Report Post  
Niek Otten
 
Posts: n/a
Default

Very clever! I'm afraid I'll never get the hang of SUMPRODUCT formulas,
especially those with "--"
I used to have a colleague who said "You call that clever? That's a brain
defect!" <g

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"N Harkawat" <nharkawat@hotmail_dot_com wrote in message
...
But if you only need a formula then
=SUMPRODUCT(--(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),(10^(ROW(I NDIRECT("1:"&LEN(A1))))))/10
where cell A1 holds the value to be transposed/swapped
So 561 in A1 will become 165



"Niek Otten" wrote in message
...
You could use this User Defined Function (UDF)
Open the VB Editor (ALT+F11), InsertModule, and paste this code in the
code window.
You can now use the function from your worksheet

' ================================
Function ReverseNumber(a As String) As Long
Dim i As Long
Dim b As String
For i = Len(a) To 1 Step -1
b = b + Mid$(a, i, 1)
Next i
ReverseNumber = b
End Function
' ================================


--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Derek" wrote in message
...
Some one may have done this but I am looking at working out palindromes
on
excel and I am stuck at the first stage. I need to reverse a number
value,
example 12 is 21.

Here is an example of a palindrome

87+78=165
165+561=726
726+627=1353
1353+3531=4884