View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Is it possible...

John,

This line isn't required, I used it for debugging and forgot to delete it

letter = CLng(Mid(str, x, 2))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Mike H" wrote:

John,

I thibk this 'idea' is going to be a minefield of potential errors but
here's a UDF that works for you posted example.


Function NumLtr(str As String) As String
s = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y ,z"
v = Split(s, ",")
For x = 1 To Len(str) Step 2
letter = CLng(Mid(str, x, 2))
NumLtr = NumLtr + v(CLng(Mid(str, x, 2)) - 1)
Next
End Function
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"John Smith" wrote:

To convert a text value to a number using a defined rule in Excel, say a
macro or some other formula? Take for example, say the value "Instructor"
mapping to 09141920182103201518 with each letter corresponding to its
position in the alphabet represented by a two digit number. However, the
longer the word, the longer the numerical string, so I would like to be able
to limit this in some way.

I do not yet know which words or phrases will be entered, but is there some
hash function available that will keep the numeric strings relatively short?


.