Do you need to reverse a number in your report or dashboard? This blog post cover 8 advanced methods to reverse the number in an Excel spreadsheet.
A word, phrase, or sequence that reads the same backward as forward is called a palindrome. Reversing numbers may be used for checking palindromes.
When a number is reversed, the digits are rearranged in reverse order, starting with the final digit, then the second-to-last digit, and so on, with the first digit appearing last.
Example: Reverse the number 123456 and return the output as 654321.
Reverse Numbers are useful for encryption and other types of secure data processing. Computer programmers used to reverse the number to encode or decode the data.
This article explores, how to reverse the number in Excel using a Combination of Excel in-built functions, CONCAT, TEXTJOIN, LAMBDA, and LET. You have the Power Query method to handle multiple data files or large data. Also, the VBA and Office Scripts methods help you to reverse the number in Excel for your automation report and dashboard projects.
Suppose you have the number in Cell A2 and need it to reverse in Cell B2.

Get your copy of the example workbook used in this post to follow along!
Reverse Numbers in Excel with CONCAT function
Excel does not have the in-built function to reverse the string. You can use the Excel CONCAT function along with other in-built functions to reverse the number in Excel.
LEN( text )It returns the number of characters in the text.
SEQUENCE( rows, [columns], [start], [step] )It generates a list of sequential numbers in an array.
MID( text, start_num, num_chars)MID function returns a specific number of characters from a text.
CONCATENATE( txt1, [txt2], ...)CONCATENATE function joins two or more texts.

Type the formula =CONCAT( MID( A2, SEQUENCE( LEN( A2 ), , LEN( A2 ), -1 ), 1 ) ) * 1 in cell B2, and then Press the Enter button.
In the above formula, the LEN function returns 6, the number of digits in cell A2. SEQUENCE function generates an array (6,5,4,3,2,1). The MID function returns the specific digit from the position. CONCAT joins all the digits returned by the function MID. Finally, multiply by 1 to convert the text to a number.
Each function and the respective output for the number in cell A2
| Functions | LEN() | SEQUENCE() | MID() | CONCAT() |
| OUTPUT | 6 | 6 5 4 3 2 1 | 6 5 4 3 2 1 | 654321 |
Reverse Numbers in Excel with TEXTJOIN function
In this section, you are going to use the TEXTJOIN function instead of CONCAT function with all other functions MID, SEQUENCE and LEN. TEXTJOIN allows you to combine various cell texts into a single cell.

Type the formula =TEXTJOIN( "", 1, MID( A2, SEQUENCE( LEN( A2 ), , LEN( A2 ), -1 ), 1 ) ) * 1 in cell B2, and then Press the Enter button.
In the above formula, the LEN function returns 6, the number of digits in cell A2. SEQUENCE function generates an array (6,5,4,3,2,1). MID function returns the specific digit from the position. The TEXTJOIN function concatenates all the digits with an empty delimiter. Finally, multiply by 1 to convert the text to a number.
Reverse Numbers in Excel with Combination of functions
This method is used 7 in-built functions, more complex than all other methods to reverse the number. It reverses only the number, not the text.

Type the formula =RIGHT( SUM( VALUE( MID( A2 & "1", ROW( INDIRECT( "1:" & LEN( A2 & "1" ) ) ), 1 ) ) * 10 ^ ( ROW( INDIRECT( "1:" & LEN( A2 & "1" ) ) ) -1 ) ), LEN( A2 ) ) * 1 in cell B2, and then Press the Enter button.
Reverse Numbers in Excel with LAMBDA function
You will learn the Excel advanced LAMBDA function and how to reverse the number using it. LAMBDA function allows you to create custom formulas to define your own functions using one or more expressions by passing arguments into the function. It is useful for processing complex data sets or equations.
LAMBDA ( parameter or calculation ) ( function call )
Example: LAMBDA( x, y, x + y ) ( 2, 3 ); the Excel assigns the integer value 2 to the variable x, 3 to Y, computes x + y and returns the value.

Type the formula =LAMBDA( txt, CONCAT( MID( txt, SEQUENCE( LEN( txt ), , LEN( txt ), -1 ), 1 ) ) * 1 ) ( A2 ) in cell B2, and then Press the Enter button.
LAMBDA function assigns the A2 value to the variable txt and passes the variable inside the CONCAT function and processes the function. As explained in the above CONCAT method section, CONCAT reverses the text. Finally, multiply by 1 to convert the text to a number.
Use the Defined Names command with LAMBDA Function

Select the command Define Name in the Formula Tab, to open the New Name dialog box. Type the name ReverseNumber in the Name input box. Type the formula =LAMBDA( txt, CONCAT( MID( txt, SEQUENCE( LEN( txt ), , LEN( txt ), -1 ), 1 ) ) ) in the Refers to input box and press the OK button.
Once you defined the name you can call the name ReverseNumber anywhere in your workbook. It works like a custom function in Excel.

Type the formula =ReverseNumber( A2 ) * 1 in cell C2, and then Press the Enter button.
Reverse Numbers in Excel with LET function
The Excel LET function allows you to set the value of a variable, and then can be used in other functions or calculations. This helps you to use the previous function result to the subsequent function in the same cell.
LET( name1, name_value1, calculation_or_name2, [ name_value2, calculation_or_name3… ] )
Example: LET( x, 2, y, 3, x + y ); the Excel assigns the integer value 2 to the variable x, 3 to Y, computes x + y, and returns the value.

Type the formula =LET( txt, A2, CONCAT( MID( txt, SEQUENCE( LEN( txt ), , LEN( txt ), -1 ), 1 ) ) ) * 1 in cell B2, and then Press the Enter button.
LET function assigns the A2 value to the variable txt and passes the variable inside the CONCAT function and processes the function. As explained in the above CONCAT method section, CONCAT reverses the text.
Reverse Numbers in Excel with POWERQUERY
In this section, you learn how to use the Power Query Text.Reverse() function to reverse the number in Excel. Excel Power Query is a tool to Extract, Transform and Load data in Excel. It allows you to connect multiple data sources, such as text files, databases, online services and other spreadsheets. Also, it helps you to format, clean, modify, and process the connected data for reporting and analysis.
Steps to use Power Query Text.Reverse function to reverse the number

- Select the range of cells A1:A2 in the Data Sheet
- Choose the option From Table/Range option in Data Tab – to open the Power Query window

- Rename the query name POWERQUERY
- Click the Data type icon to list all the data type options, and select the item Whole Number to convert the data type to Number

- Select the command Custom Column in the Add Column Tab – to open the Custom Column dialog box.
- Type the name Reverse Number in the New column name box
- Type the formula
=Text.Reverse( [Number] )in the Custom column formula input box, and Press the OK button. - This formula returns text format, you have to convert to a number using step 4.

- Select the command Close & Load and Press Close & Load To… – to popup Import Data dialog box.

- In the Import Data dialog box, select the Table option, and click the option New worksheet to insert the transformed Power Query table into a new worksheet.
Reverse Numbers in Excel with VBA
VBA is a programming language that helps you to automate Microsoft Excel repetitive tasks, and allows you to record macros, write scripts and edit macros.
Example 1:
Use the VBA function StrReverse() to reverse the number in Excel.
StrReverse( expression )It returns the reversed order of a specified string.

Sub ReverseNumber ()
' Declare the variable num
Dim num As Long
' Assign the number to the variable num
num = Sheets("VBA").Range("A2").Value
' Apply StrReverse () to reverse the given number and store it in an adjacent cell
Sheets("VBA").Range("B2").Value = StrReverse(num)
End Sub
Add the above VBA code to your module in the visual basic editor.
VBA macro first declares the variable num, Assign the cell value A2 to the variable num, where the number is stored and needs to reverse. VBA function StrReverse() reverses the number and stores it in cell B2.
To Run the ReverseNumber macro in Excel
Press the keyboard shortcut key Alt + F8, to open the Macro dialog box, Select the ReverseNumber Macro in the Macro list, and then Press Run.
Example 2:
You can use the below alternate VBA code and execute.

Sub ReverseNumber2()
' Declare the variables
Dim i As Integer
Dim revNum As String
Dim oriNum As String
' Assign the number to the variable oriNum
oriNum = Sheets("VBA").Range("A2").Value
' Initialize the variable revNum
revNum = ""
' Loop through the number of digits
For i = 1 To Len(oriNum)
revNum = Mid(oriNum, i, 1) & revNum
Next
' Reset the revNum to cell B2
Sheets("VBA").Range("B2").Value = revNum
End Sub
Macro declares the variables i, revNum, and oriNum. Assign the number in cell A2 to the variable oriNum. Initialize the variable revNum and start the for loop. In each iteration, the script uses the MID function to extract one character at the index defined by the variable i. The & operator concatenate the number return from the Mid() function back onto revNum.
Reverse Numbers in Excel with Office Scripts
Office Scripts allows you to automate difficult tasks like creating charts, recording the action, debugging the script and running. Office Scripts make it easier to collaborate and work with colleagues.
Example 1:
To reverse the number using Office Scripts, first Split the number as an individual digit array, reorder the array of digits and then Join it together.

function main(workbook: ExcelScript.Workbook) {
// Assign the worksheet to the variable
let wSheet = workbook.getWorksheet("OfficeScripts");
let celValue = wSheet.getCell(1, 0).getValue() as string
// Use toString() to convert the celValue number to a string, and split the celValue as individual character and assign it in an array
let splitText = celValue.toString().split("");
// Reverse the order of the characters in the array
let charArr = splitText.reverse();
// Join and store the number in an adjacent cell
wSheet.getCell(1, 1).setValue(charArr.join(""));
}
Add the above script to the Code Editor and then press the Save button.
The above script assigns the worksheet OfficeScripts, and cell A2 to the respective variables. The Script converts the value in the variable celValue to a string. Split the number stored as text as an individual number and assigned the list of numbers to an array. Reverse the array of items, Join the array of items, and store it in cell B2.

To Run the Reverse Number Office scripts
Select your script Reverse Number from the Office Scripts drop down items in the Automate menu and press the Run button.
Example 2:
You can use the below alternate Office Script code and execute.

function main(workbook: ExcelScript.Workbook) {
// Assign the worksheet to the variable
let wSheet = workbook.getWorksheet("OfficeScripts");
// Initialize the variables
let lastDigit = 0;
let revNum = 0;
// Assign the cell value to the variable celValue
let celValue = wSheet.getCell(1, 0).getValue() as number;
// check the celvalue is not equal to zero
while (celValue != 0){
// Extract the remainder of celValue divided by 10
lastDigit = celValue % 10;
// Multiply the revNum by 10 and add last digit
revNum = revNum * 10 + lastDigit
// Use the floor function to discard the decimal part
celValue = Math.floor( celValue / 10 )
}
// The reversed number stored in cell B2
wSheet.getCell(1, 1).setValue(revNum);
}
Script execute until the celValue is not equal to zero. Each iteration script assigns the last digit to the variable lastDigit by dividing the value by 10. Multiply the revNum variable by 10 and add the value in the variable lastDigit. celValue divide by 10 and discard the decimal part using Math.floor function. Finally, the reversed number is stored in cell B2.
Conclusions
The reverse number is easier to remember. It could give an additional level of security if you used it as a password. The reverse number is also used in programming for looping over specific tasks.
To reverse the number in Excel, you can use the combination of Excel functions with CONCAT, TEXTJOIN, LAMBDA, and LET. The Power Query method works well if you are dealing with multiple data sources or large data files. If you need to reverse the number in your automation projects, you can use either the VBA or Office Scripts code.
If you have used any other method or tricks to Reverse Numbers in Excel, let us know in the comments section at the bottom of this page.
👉 Find out more about our Advanced Formulas course!
👉 Get our Excel merch!


Another possibility with REDUCE
=REDUCE(“”, SEQUENCE(LEN(A1)), LAMBDA(x, i, MID(A1, i, 1) & x))*1
Great to always see examples of REDUCE! A very powerful function. One of my favourite new functions.
or
LET(seq, SEQUENCE(LEN(A1)), SUM(MID(A1, seq, 1) * 10^(seq-1)))