Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Create Code Based on Column

Hi....

I've got a spreadsheet with 37,000 rows - one of the columns in this
is an activity description, and many of these descriptions are
repeated multiple
times in the column. What I need to do, either with a formula or VBA,
is to assign each activity description a code in the next column in
the format T0001, T0002, etc. So, 'Job 1 = T0001, 'Job 2 = T0002,
etc.


Can anyone help?


TIA

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Create Code Based on Column

hi
formula....
=if(D2="job 1", "T0001",if(D2="job1,job2","T0002,T0002",""))
you can stack 7 ifs this way for 7 different combinations. if you have more
than 7 jobs or if the jobs are "jumbled up", you have a problem.

A macro could offer more ifs but if jumbled up ie job2, job1 instead of
job1, job2, you have a serious problem.

Regards
FSt1

"Brainfire" wrote:

Hi....

I've got a spreadsheet with 37,000 rows - one of the columns in this
is an activity description, and many of these descriptions are
repeated multiple
times in the column. What I need to do, either with a formula or VBA,
is to assign each activity description a code in the next column in
the format T0001, T0002, etc. So, 'Job 1 = T0001, 'Job 2 = T0002,
etc.


Can anyone help?


TIA


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Create Code Based on Column

Another option....

Use data|filter|advanced filter to get a list of unique descriptions into
another sheet.

Debra Dalgleish shows how:
http://www.contextures.com/xladvfilter01.html#FilterUR

Delete the headers in row 1
and sort the list if you want.

then in B1, put this formula:
="T"&text(row(),"0000")
and drag down.

Then convert these to values (edit|copy, edit|paste special|values)

Then back to the original sheet
insert a new column that's adjacent to the descriptions
and use something like:
=vlookup(a2,sheet2!a:b,2,false)
to return the code.

Debra Dalgleish has lots of notes on =vlookup():
http://www.contextures.com/xlFunctions02.html

Brainfire wrote:

Hi....

I've got a spreadsheet with 37,000 rows - one of the columns in this
is an activity description, and many of these descriptions are
repeated multiple
times in the column. What I need to do, either with a formula or VBA,
is to assign each activity description a code in the next column in
the format T0001, T0002, etc. So, 'Job 1 = T0001, 'Job 2 = T0002,
etc.

Can anyone help?

TIA


--

Dave Peterson
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
Code help, delete rows based on column criteria Stout Excel Discussion (Misc queries) 2 March 20th 07 01:17 PM
Why doesn't the code create a column stacked chart? tskogstrom Charts and Charting in Excel 3 October 26th 06 05:27 PM
CREATE NEW WORKBOOK AND SHEETS BASED ON COLUMN DATA control freak Excel Worksheet Functions 2 July 20th 06 06:00 PM
How to create a form to insert a hyerlink.VBA code to create a for karthi Excel Discussion (Misc queries) 0 July 5th 06 11:26 AM
how to create a chart based on the content of a column yefei Excel Discussion (Misc queries) 1 February 23rd 06 06:27 AM


All times are GMT +1. The time now is 12:06 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"