Loading
Excel.Tips.Net ExcelTips (Menu Interface)

Working with Roman Numerals

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.

Related Tips:

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

 

Leave your own comment:

*Name:
Email:
  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*Text:
*What is 5+3 (To prevent automated submissions and spam.)
 
 
           Commenting Terms

Comments for this tip:

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
 
 

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us

 

Advertise with Us

Our Privacy Policy

Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives

 

Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.