# Working with Roman Numerals

by Allen Wyatt
(last updated November 25, 2016)

Excel includes a worksheet function that allows you to convert a number to Roman numerals. (Hmmm. Let's see... I was born in MCMLVI. Dang! I'm a classic!) The simplest way to use the Roman numerals is as follows:

=ROMAN(123)

All you need to do, obviously, is replace 123 with the number you want converted. You can use any number between 1 and 3999. (Romans apparently never worked with numbers outside this range.)

You can also, if desired, use a second argument to indicate how the resulting Roman numerals should be put together. The different arguments you can use are 0 through 4, with 0 being the default. An argument of 0 returns Roman numerals in the classic form, and 4 returns an extremely simplified Roman numeral. Values between 0 and 4 return progressively more simplified versions. The simplification of Roman numerals typically only comes into play when dealing with larger numbers. For instance, the following shows the various levels of simplification of the number 1999:

Formula Result =ROMAN(1999,0) MCMXCIX =ROMAN(1999,1) MLMVLIV =ROMAN(1999,2) MXMIX =ROMAN(1999,3) MVMIV =ROMAN(1999,4) MIM

You should note that the ROMAN function returns a text value, and you therefore cannot use the result in any sort of calculation—as far as Excel is concerned, it is no longer a number.

Older versions of Excel (including Excel 2003) do not include a function to convert Roman numerals back to Arabic numbers. If you want to use a formulaic approach to do the conversion, you can try this:

=MATCH(A1,INDEX(ROMAN(ROW(INDIRECT("1:4000"))),0),0)

This presumes that the Roman numerals are in cell A1. If you prefer, you can create your own user-defined function to do the conversion to Arabic:

Public Function UnRoman(RomanNumber As String) As Integer
Dim MySum As Integer
Dim MyDeduct As Integer
Dim MyWord As String
Dim L As String
Dim WordLength As Integer
Dim i As Integer
Dim MyArray() As Integer

MySum = 0
MyDeduct = 0
MyWord = UCase(RomanNumber)
WordLength = Len(MyWord)
ReDim MyArray(WordLength + 1)

For i = 1 To WordLength
L = Mid(MyWord, i, 1)
MyArray(i) = Switch(L = "I", 1, L = "V", 5, _
L = "X", 10, L = "L", 50, L = "C", 100, _
L = "D", 500, L = "M", 1000)
MySum = MySum + MyArray(i)
Next
For i = 1 To WordLength - 1
If MyArray(i) < MyArray(i + 1) Then
MyDeduct = MyDeduct + MyArray(i)
End If
Next
'Now deduct twice the value of the subtraction numbers
UnRoman = MySum - 2 * MyDeduct
End Function

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (1956) applies to Microsoft Excel 97, 2000, 2002, and 2003.

##### Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

##### MORE FROM ALLEN

Marking Multiple Documents

After using Word for a while, it is easy to accumulate quite a few documents. At some point you may want to make a change ...

Discover More

Converting Imported Information to Numeric Values

If the information you import into Excel is treated as text by the program, you may want to convert it to numeric values. ...

Discover More

Replacing Some Smart Quotes

Smart quotes look great in a document, but may not be right for all instances of quote marks or apostrophes. If you need ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

##### More ExcelTips (menu)

Calculating Fractions of Years

When working with dates and the relationship between dates, Excel provides a variety of worksheet functions that may ...

Discover More

Converting Strings to Numbers

When working with data in a macro, there are two broad categories you can manipulate: numbers and text. Sometimes you ...

Discover More

Returning a Blank Value

Is it possible for a formula to return a blank value? It depends on how you define your terms. This tip examines all the ...

Discover More
##### Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. Youâ€™ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one less than 2?

2021-03-01 20:50:50

Susan Weil

Is it possible to sort a table by roman numerals, instead of converting it to arabic and then back to roman?

2020-06-01 15:44:31

roy

"0" was "classic" for a reason: it was how you applied the number onto an abacus. Of course, for non-math usages, maybe how much chiseling you had to do in stone ruled...

##### This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.