The ROMAN function in Google Sheets converts numbers into Roman numerals.
This function is particularly useful for those interested in presenting numbers in a classical style, whether for educational, historical, or aesthetic purposes.
🔗 Grab the template at the bottom of this article.
ROMAN Function Syntax
=ROMAN(number, [rule_relaxation])
It takes two arguments:
number
: The number you want to convert to a Roman numeral. It must be a positive integer between 1 and 3999, otherwise the function returns an error.
[rule_relaxation]
(optional): This determines the type of Roman numeral representation. The value ranges from 0 to 4, controlling the compactness of the numeral. The default value is 0.
Rule Relaxation
The value of the rule_relaxation argument is an integer between 0 and 4 inclusive.
It affects the form of the Roman numeral. Each successive number relaxes the rules of Roman numeral formation, leading to more compact and less traditional representations.
- Strict Traditional Form: Following the classic Roman numeral rules, where I may only precede V and X, V may only precede X, X may only precede L and C, L may only precede C, and C may only precede D and M. Thus 999 is represented as “CMXCIX”.
- Slightly Relaxed Rules: With slightly relaxed rules, 999 becomes “LMVLIV”. In this form, the numeral “L” (50) can precede “M” (1000), which is not allowed in the traditional form.
- More Relaxed Rules: Here, 999 is represented as “XMIX”. This form allows for “X” (10) to precede “M” (1000), making the numeral more compact.
- Even More Relaxed Rules: At this level, 999 is written as “VMIV”. This allows “V” (5) to precede “D” (500) and “M” (1000), further simplifying the numeral.
- Most Relaxed Form: In the most relaxed form, 999 is simply “IM”. This allows “I” (1) to directly precede “D” (500) and “M” (1000), resulting in the most compact version of the numeral.
Using The ROMAN Function
Suppose you have the following dataset:
To convert these years into Roman numerals, use the ROMAN function as follows:
For 1950:
=ROMAN(A2)
or
=ROMAN(1950)
For 2023:
=ROMAN(A3)
For 1776:
=ROMAN(A4)
The adjacent cells will display the Roman numeral equivalents for these years:
Other Roman Formula Ideas Examples
Combine the ROMAN function with other functions like IFERROR function or IF function, to handle invalid years and avoid errors.
For example, this IFERROR wrapper gives a helpful error message:
=IFERROR(ROMAN(5000),"Must be a positive integer between 1 and 3999 for ROMAN to work.")
whereas this IF formula with a nested OR function only converts valid numbers with the ROMAN function:
=IF(OR(A2<1,A2>3999),A2,ROMAN(A2))
Create an Historical Timeline
Creating a timeline of historical events using Roman numerals can add a unique classical touch. Use the ROMAN function alongside the dates for a distinctive presentation.
ROMAN Function Template
Click here to open a view-only copy >>
Feel free to make a copy: File > Make a copy…
If you can’t access the template, it might be because of your organization’s Google Workspace settings. Right-click the link to open it in an Incognito window to view it.
It’s part of the Text family of functions in Google Sheets. You can read about it in the Google Documentation.
Although the subject of this post is an esoteric and rarely used function in Google Sheets, the post itself marks a significant watershed moment. Let me explain.
It’s the first post on this site where AI and Apps Script wrote the initial draft.
I built a custom GPT model and trained it on existing blog posts from this site. It wrote the first draft based on the prompt “Draft a blog post about the ROMAN function in Google Sheets”. I then “chatted” with the GPT to refine the initial draft. For anyone interested, you can see my chat here.
I used Apps Script to generate a folder in Drive containing the Google Sheets template.
Then I corrected the errors, and added real-world examples, images, and the template links to the post. Lest you think this is just a pump-and-dump AI scheme, I have 28 revisions in my WordPress history, between the AI draft and pressing publish :).
This AI method cut the publishing time by 50 – 75%.
I will continue to refine this method and I’ll publish a tutorial on creating high-quality technical content at scale.