Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Creating a Vendor ID from Vendor Name...

I have a column which contains Vendor names in a spreadsheet with Vendor
data. I created a formula that takes the first 3 char. of the Vendor Name,
then looks for a space then takes the next 3 char. after the space and
concatenates the 2 together to create a Vendor ID. Here's the formula:
=LEFT(C2,3)&TRIM(MID(C2,FIND(" ",C2&" "),4)). So, for a vendor name that
contains ADMIRAL CRAFT EQUIP., my Vendor ID = ADMCRA. Problem: A lot of the
Vendor Names contain just one word such as AD-SENSATION or T.W.C., etc. My
formula for these 2 produces AD- and T.W repectively.

Anyone have an idea how to modify my formula to test if the Vendor Name just
contains one string of char. with no space inbetween and then just take the
first 6 char. or if a space do my concatenation?

Tks,
Don
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Creating a Vendor ID from Vendor Name...

Try something like =IF(ISERROR(FIND(A1,"
"),LEFT(A1,6),LEFT(A1,3)&TRIM(MID(A1,FIND(" ",A1&" "),4)))

Dave


--
Brevity is the soul of wit.


"Donald King" wrote:

I have a column which contains Vendor names in a spreadsheet with Vendor
data. I created a formula that takes the first 3 char. of the Vendor Name,
then looks for a space then takes the next 3 char. after the space and
concatenates the 2 together to create a Vendor ID. Here's the formula:
=LEFT(C2,3)&TRIM(MID(C2,FIND(" ",C2&" "),4)). So, for a vendor name that
contains ADMIRAL CRAFT EQUIP., my Vendor ID = ADMCRA. Problem: A lot of the
Vendor Names contain just one word such as AD-SENSATION or T.W.C., etc. My
formula for these 2 produces AD- and T.W repectively.

Anyone have an idea how to modify my formula to test if the Vendor Name just
contains one string of char. with no space inbetween and then just take the
first 6 char. or if a space do my concatenation?

Tks,
Don

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Creating a Vendor ID from Vendor Name...

Try this:
=CONCATENATE(LEFT(A1,3),MID(A1,FIND(" ",A1,1)+1,3))


"Donald King" wrote:

I have a column which contains Vendor names in a spreadsheet with Vendor
data. I created a formula that takes the first 3 char. of the Vendor Name,
then looks for a space then takes the next 3 char. after the space and
concatenates the 2 together to create a Vendor ID. Here's the formula:
=LEFT(C2,3)&TRIM(MID(C2,FIND(" ",C2&" "),4)). So, for a vendor name that
contains ADMIRAL CRAFT EQUIP., my Vendor ID = ADMCRA. Problem: A lot of the
Vendor Names contain just one word such as AD-SENSATION or T.W.C., etc. My
formula for these 2 produces AD- and T.W repectively.

Anyone have an idea how to modify my formula to test if the Vendor Name just
contains one string of char. with no space inbetween and then just take the
first 6 char. or if a space do my concatenation?

Tks,
Don

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Creating a Vendor ID from Vendor Name...

=LEFT(C2,3)&MID(C2,IF(FIND(" ",C2&" ")LEN(C2),4,FIND(" ",C2)+1),3)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Donald King" wrote in message
...
I have a column which contains Vendor names in a spreadsheet with Vendor
data. I created a formula that takes the first 3 char. of the Vendor

Name,
then looks for a space then takes the next 3 char. after the space and
concatenates the 2 together to create a Vendor ID. Here's the formula:
=LEFT(C2,3)&TRIM(MID(C2,FIND(" ",C2&" "),4)). So, for a vendor name that
contains ADMIRAL CRAFT EQUIP., my Vendor ID = ADMCRA. Problem: A lot of

the
Vendor Names contain just one word such as AD-SENSATION or T.W.C., etc.

My
formula for these 2 produces AD- and T.W repectively.

Anyone have an idea how to modify my formula to test if the Vendor Name

just
contains one string of char. with no space inbetween and then just take

the
first 6 char. or if a space do my concatenation?

Tks,
Don



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Creating a Vendor ID from Vendor Name...

Hi all,
Thanks for all the help. I tried the suggestions from Dave and Teethless
but on cells with just one word the fuction returns a #value. Bob's works
just fine.

Tks,
Don

"Donald King" wrote:

I have a column which contains Vendor names in a spreadsheet with Vendor
data. I created a formula that takes the first 3 char. of the Vendor Name,
then looks for a space then takes the next 3 char. after the space and
concatenates the 2 together to create a Vendor ID. Here's the formula:
=LEFT(C2,3)&TRIM(MID(C2,FIND(" ",C2&" "),4)). So, for a vendor name that
contains ADMIRAL CRAFT EQUIP., my Vendor ID = ADMCRA. Problem: A lot of the
Vendor Names contain just one word such as AD-SENSATION or T.W.C., etc. My
formula for these 2 produces AD- and T.W repectively.

Anyone have an idea how to modify my formula to test if the Vendor Name just
contains one string of char. with no space inbetween and then just take the
first 6 char. or if a space do my concatenation?

Tks,
Don

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help creating invoice in excel based on data and [email protected] Excel Discussion (Misc queries) 1 August 22nd 06 10:47 AM
Help needed - creating invoice from packing list (both in excel) [email protected] Excel Discussion (Misc queries) 0 August 22nd 06 10:13 AM
Creating username and passwords shannyshanhan Excel Worksheet Functions 3 August 7th 06 10:24 AM
Creating an invoice with a lookup list wings Excel Discussion (Misc queries) 6 October 30th 05 02:37 AM
Eliminate creating list that returns blank cells Marc Todd Excel Worksheet Functions 1 January 26th 05 09:58 PM


All times are GMT +1. The time now is 09:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"