View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default What function to use? Len?

The 20 is the total length of the words 'American Can Company'.

As you've seen already, there are cases where using almost anything other
than a dedicated unique number generator is going to occassionally give you
duplicates. But even that situation gives you big leg up. You could use one
of the schemes that folks come up with here to get the initial list, then
sort by the generated IDs, and modify the ones that are duplicated or even
try this (or think of it as a possible scheme, but as long as the list is on
1 sheet, then numbers should be unique <g).

=Left(A1,5) & Text(ROW(),"000")
and when you're done select all cells with the formula in them and Copy
followed by Edit -- Paste Special with 'Values' selected to convert the
results into entries that won't change.

Or
=Left(A1,5) & Text(ROW()*5,"000")
to give yourself a 'gap' of 4 numbers between entries for others that may
get added to your list in the future. Larger gaps may require you to go to
more digits than just 3, as
=Left(A1,5) & Text(ROW()*5,"0000")


Also, now is probably a good time to decide if a 3-digit number is going to
be 'good enough' over an extended period of time, or if you may want to use 4
or 5 digits?

"mklafert" wrote:

That seems to work but tell me where the number is coming from?

"Bernard Liengme" wrote:

With A1 holding: American Can Company
This formula =LEFT(A1,5)&LEN(A1) returns Ameri20
I am not sure where you got the 125 from
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"mklafert" wrote in message
...
I am going to create customer ID - Alphanumeric. I have the whole company
names and I was trying to come up with a scheme that I can use an Excel
Function to make the process faster. I thought about Len but not sure -
Is
there a command where I can say give me Say the first letter of the
company
name and numbers behind it.

Such as

American Can Company - Result of Function - Ameri125

If this is even possible


.