How To Calculate Roman Numerals

Spreadsheets,Tips 14 March 2011 0 Comments

Given a number, are you able to express it as a roman numeral? In roman, numerals are represented as letters (I for 1, V for 5, X for 10 and so on). These roman numerals are additive; the number is calculated by adding all the letters together, for example: LX = 50 + 10 which equals 60. If a smaller number precedes a larger number, the smaller number gets subtracted first before adding the letters together. For example: IV = 5 – 1 which equals 4.

Figuring out how to represent a number as a roman numeral is easy with Google Docs spreadsheets:

  • In a cell use the roman() function. You provide the number, or a reference to a cell with the number, as a parameter to this method. For example, let’s say you would like the roman numeral for the number in cell A2 to appear in B2. Use the following formula in B2:
=roman(A2)

There are strict rules when specifying roman numerals, specifically which kind of characters can precede another kind of character. For example, following the strictest rules, 999 in roman numerals is CMXCIX. You might notice that 999 is one less than 1000 (which is represented as M in roman numerals). If you relax the rules, you might represent 999 as IM, i.e. subtract 1 from 1000. It’s not strictly correct, but is definitely more succinct! You can relax the rules by providing a 0, 1, 2, 3 or 4 as a second parameter to the roman() method, where the higher the number, the more the rules are relaxed. For example, the get the simplest form of roman numeral for the number in A2 in cell B3:

  • Use the roman() function in cell B3, using A2 as the first parameter and 4 as the second parameter:
=roman(A2, 4)

The actual spreadsheet used in this example can be found here.

Tagged in , , ,

Leave a Reply