View Single Post
  #6   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Harlan,

Then I should have been clearer: "No, there is no built-in Excel function,
but you can use ....."

HTH,
Bernie
MS Excel MVP


"Harlan Grove" wrote in message
oups.com...
Bernie Deitrick wrote...
No. You need to use a UDF. . . .


No you don't. This can be done with formulas, and not terribly complex
ones.

=SUMPRODUCT(LEN(x)-LEN(SUBSTITUTE(x,{"M";"D";"C";"L";"X";"V";"I"},"") ),
{1000;500;100;50;10;5;1})

+SUMPRODUCT(LEN(C1)-LEN(SUBSTITUTE(C1,{"CM";"CD";"XC";"XL";"IX";"IV";0 },""))
,
{-100;-100;-10;-10;-1;-1;0})