• We are pleased to announce that the winner of our Feedback Prize Draw for the Winter 2024-25 session and winning £150 of gift vouchers is Zhao Liang Tay. Congratulations to Zhao Liang. If you fancy winning £150 worth of gift vouchers (from a major UK store) for the Summer 2025 exam sitting for just a few minutes of your time throughout the session, please see our website at https://www.acted.co.uk/further-info.html?pat=feedback#feedback-prize for more information on how you can make sure your name is included in the draw at the end of the session.
  • Please be advised that the SP1, SP5 and SP7 X1 deadline is the 14th July and not the 17th June as first stated. Please accept out apologies for any confusion caused.

Excel Challenge #9

Steve Hales

ActEd Tutor
Staff member
Got Excel skills? Let's see.

This one's a classic ;)

Here are the usual rules.
  • Create a single Excel formula to solve the stated problem.
  • The shortest formula wins (when calculating the length of the formula there's no need to include the leading "=", or the curly braces that Excel uses to represent array formulae).
  • The formula's number format can be set to whatever you want.
  • Conditional formatting is not allowed.
Problem #9

Assume that cell A1 contains a positive integer value less than 4,000. Create a single formula to convert the value in A1 to Roman numerals. More specifically, the challenge is to replicate Excel's =ROMAN(A1, 0) function. For example

A1
4 --> IV
19 --> XIX
49 --> XLIX
501 --> DI
1999 --> MCMXCIX
2015 --> MMXV
 
I'm sure there's some room for improvement here;

Code:
=REPT("M",LEFT(RIGHT("000" & A1,4))) & 
CHOOSE(LEFT(RIGHT("000" & A1,3))+1,"","C","CC","CCC","CD","D","DC","DCC","DCCC","CM") & 
CHOOSE(LEFT(RIGHT("000" & A1,2))+1,"","X","XX","XXX","XL","L","LX","LXX","LXXX","XC") & 
CHOOSE(LEFT(RIGHT("000" & A1,1))+1,"","I","II","III","IV","V","VI","VII","VIII","IX")
 
I'm sure there's some room for improvement here;
there is,
Code:
=REPT("M",QUOTIENT(A1,1000))&CHOOSE(LEFT(RIGHT(0&A1,3))+1,"","C","CC","CCC","CD","D","DC","DCC","DCCC","CM")&CHOOSE(LEFT(RIGHT(0&A1,2))+1,"","X","XX","XXX","XL","L","LX","LXX","LXXX","XC")&CHOOSE(RIGHT(A1),"I","II","III","IV","V","VI","VII","VIII","IX")

I did made my formula just like you but in MOD(QUOTIENT):cool:(It was shorter)..... Now, I see, after modification yours better;)
 
I don't think this breaks the rules:

VLOOKUP(A1,TABLE,2)

where TABLE is the obvious.
 
Back
Top