Return the digits in reverse order

Thanks to David Hager for this original formula.
You can return the digits of a number (that has less than 15 digits) in reverse order by using an array formula.
This formula returns a text value (left aligned) to allow for any numbers that end with a zero.
This formula must be entered as an array formula using (Ctrl + Shift + Enter).

2=RIGHT(SUM(VALUE(MID(A1&"1",ROW(INDIRECT("1:"&LEN(A1&"1"))),1))*10^(ROW(INDIRECT("1:"&LEN(A1&"1")))-1)),LEN(A1)) = 12345678
5=RIGHT(SUM(VALUE(MID(A4&"1",ROW(INDIRECT("1:"&LEN(A4&"1"))),1))*10^(ROW(INDIRECT("1:"&LEN(A4&"1")))-1)),LEN(A4)) = 10101
8=RIGHT(SUM(VALUE(MID(A7&"1",ROW(INDIRECT("1:"&LEN(A7&"1"))),1))*10^(ROW(INDIRECT("1:"&LEN(A7&"1")))-1)),LEN(A7)) = 0543210987654300
11=RIGHT(SUMPRODUCT(VALUE(MID(A10&"1",ROW(INDIRECT("1:"&LEN(A10&"1"))),1))*10^(ROW(INDIRECT("1:"&LEN(A10&"1")))-1)),LEN(A10)) = 9876543210987700000
14=RIGHT(SUM(VALUE(MID(A13&"1",ROW(INDIRECT("1:"&LEN(A13&"1"))),1))*10^(ROW(INDIRECT("1:"&LEN(A13&"1")))-1)),LEN(A13)) = 1E+32

Cell "A1" contains the number 87,654,321.
Cell "A2" contains the array formula that reverses these digits.
Cell "A4" contains the binary number 101010.
Cell "A5" contains the array formula that reverses these digits. Notice that it has removed the zero from the front.
Cell "A7" contains a number that has more than 15 digits.
Cell "A8" contains the array formula that tries to reverse these digits. Notice that some rounding has taken place and that this is not exactly the same number.
If you want to reverse more than 15 digits then you will need to use the REVERSE User Defined Function.

User Defined Function

REVERSE - Returns the contents of a cell with all the characters reversed.

Related Formulas

Return the words in reverse order

© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited Top