Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
excel function to format cells adding a hyphen to some cell contents
Old 09-02-2008, 07:49 AM excel function to format cells adding a hyphen to some cell contents
Junior Talker

Posts: 1
Trades: 0
We periodically receive updated price lists with about 5000 items. I have two problems that I need help with.

The first problem is that some of the part ids are in the format XX5-0808, some have an additional letter XX5-1206K and some have two hyphens XX5-06-04K. There are about 30 different combinations of numbers in the part ids. In order to import the items into our system I need all the part ids to be in the format with the two hyphens. I need a worksheet function that does the following:
if two "-" in the cell then do nothing
if one "-" in the cell then insert "-" 2 characters from end, unless the last character is a letter then insert 3 characters from the end

The second problem I have is that while the updated price list contains 5000 items we hold only about 1500 of those items. I can export our item list to an excel file. I need to find a way to compare each item and mark the items where the part id appears in both worksheets (or mark the items where the part id appears in only one worksheet) so that I can import only those items that we stock.
carolyn is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-04-2008, 04:40 PM Re: excel function to format cells adding a hyphen to some cell contents
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
You need to write some code, or to hire somebody to do it for you. Depending on part on your version of Excel, and in part on your skill, motivation, and willingness to write code, your options are Visual Basic for Applications, and .NET for Microsoft Office.

http://www.functionx.com/vbaexcel/index.htm
http://www.ozgrid.com/VBA/

You'll need looping constructs (for each item in your list), you'll need to get used to IF THEN ELSE logic, and string manipulation.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to excel function to format cells adding a hyphen to some cell contents
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10163 seconds with 12 queries