Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default lookup combined with search to find keywords and then assign a cat

I've been struggling with a project where I have to take hundreds of
spreadsheets with thousands of contact records. Each record has a field
called "Title" and a field called "Job Function". We have each contact's
specific title, but then we want to categorize them in the "Job Function"
field as an executive, director, supervisor, employee, or faculty. In order
to have to go through and read each title and individually assign a function,
I would like to program an IF or LOOKUP statement combined with a SEARCH
statement to look for key words in the title field and then assign them one
of the function titles. What am I doing wrong here? Right now, I get #VALUE
for any title except for president. I also need to do a lookup table,
because I have more than seven keywords I'd like to search for. Thanks, Jason

Title Function
President President
CEO #VALUE
VP #VALUE

=IF((SEARCH("president",M3)),"Executive",IF((SEARC H("ceo",M3)),"Executive",IF((SEARCH("vp",M3)),"Exe cutive","nothing")))
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default lookup combined with search to find keywords and then assign a cat

search returns an error if it isn't found, so it might be better to use countif

=IF(COUNTIF(M3,"*president*"),"Executive",IF(COUNT IF(M2,"*ceo*"),"Executive",IF(COUNTIF(M3,"*vp*")," Executive","nothing")))

However, you can only nest if statements 7 deep, so I don't know if this is
going to fill the bill so to speak. (countif is case insensitive)

--
Regards,
Tom Ogilvy




"jalbert1975" wrote:

I've been struggling with a project where I have to take hundreds of
spreadsheets with thousands of contact records. Each record has a field
called "Title" and a field called "Job Function". We have each contact's
specific title, but then we want to categorize them in the "Job Function"
field as an executive, director, supervisor, employee, or faculty. In order
to have to go through and read each title and individually assign a function,
I would like to program an IF or LOOKUP statement combined with a SEARCH
statement to look for key words in the title field and then assign them one
of the function titles. What am I doing wrong here? Right now, I get #VALUE
for any title except for president. I also need to do a lookup table,
because I have more than seven keywords I'd like to search for. Thanks, Jason

Title Function
President President
CEO #VALUE
VP #VALUE

=IF((SEARCH("president",M3)),"Executive",IF((SEARC H("ceo",M3)),"Executive",IF((SEARCH("vp",M3)),"Exe cutive","nothing")))

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default lookup combined with search to find keywords and then assign a

Tom,
It seems like my IF statement is case sensitive right now. I will try
adding the asterisks.
How could I do it using LOOKUP so that I could have more than seven search
statements?
Thanks, Jason

"Tom Ogilvy" wrote:

search returns an error if it isn't found, so it might be better to use countif

=IF(COUNTIF(M3,"*president*"),"Executive",IF(COUNT IF(M2,"*ceo*"),"Executive",IF(COUNTIF(M3,"*vp*")," Executive","nothing")))

However, you can only nest if statements 7 deep, so I don't know if this is
going to fill the bill so to speak. (countif is case insensitive)

--
Regards,
Tom Ogilvy




"jalbert1975" wrote:

I've been struggling with a project where I have to take hundreds of
spreadsheets with thousands of contact records. Each record has a field
called "Title" and a field called "Job Function". We have each contact's
specific title, but then we want to categorize them in the "Job Function"
field as an executive, director, supervisor, employee, or faculty. In order
to have to go through and read each title and individually assign a function,
I would like to program an IF or LOOKUP statement combined with a SEARCH
statement to look for key words in the title field and then assign them one
of the function titles. What am I doing wrong here? Right now, I get #VALUE
for any title except for president. I also need to do a lookup table,
because I have more than seven keywords I'd like to search for. Thanks, Jason

Title Function
President President
CEO #VALUE
VP #VALUE

=IF((SEARCH("president",M3)),"Executive",IF((SEARC H("ceo",M3)),"Executive",IF((SEARCH("vp",M3)),"Exe cutive","nothing")))

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default lookup combined with search to find keywords and then assign a

Tom,
Yes, the COUNTIF does work better than search. Thanks

"jalbert1975" wrote:

Tom,
It seems like my IF statement is case sensitive right now. I will try
adding the asterisks.
How could I do it using LOOKUP so that I could have more than seven search
statements?
Thanks, Jason

"Tom Ogilvy" wrote:

search returns an error if it isn't found, so it might be better to use countif

=IF(COUNTIF(M3,"*president*"),"Executive",IF(COUNT IF(M2,"*ceo*"),"Executive",IF(COUNTIF(M3,"*vp*")," Executive","nothing")))

However, you can only nest if statements 7 deep, so I don't know if this is
going to fill the bill so to speak. (countif is case insensitive)

--
Regards,
Tom Ogilvy




"jalbert1975" wrote:

I've been struggling with a project where I have to take hundreds of
spreadsheets with thousands of contact records. Each record has a field
called "Title" and a field called "Job Function". We have each contact's
specific title, but then we want to categorize them in the "Job Function"
field as an executive, director, supervisor, employee, or faculty. In order
to have to go through and read each title and individually assign a function,
I would like to program an IF or LOOKUP statement combined with a SEARCH
statement to look for key words in the title field and then assign them one
of the function titles. What am I doing wrong here? Right now, I get #VALUE
for any title except for president. I also need to do a lookup table,
because I have more than seven keywords I'd like to search for. Thanks, Jason

Title Function
President President
CEO #VALUE
VP #VALUE

=IF((SEARCH("president",M3)),"Executive",IF((SEARC H("ceo",M3)),"Executive",IF((SEARCH("vp",M3)),"Exe cutive","nothing")))

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default lookup combined with search to find keywords and then assign a

Ok, so now that I've fixed the search part, how can I nest it in a LOOKUP
statement? Here's what I'm trying that's not working:
LOOKUP(M5,{(COUNTIF(M5,"*president*")),(COUNTIF(M5 ,"*ceo*")),(COUNTIF(M5,"*vp*")),(COUNTIF(M5,"*dire ctor*")),(COUNTIF(M5,"*supervisor*")),(COUNTIF(M5, "*manager*")),(COUNTIF(M5,"*engineer*")),(COUNTIF( M5,"*staff*"))},{"Executive","Executive","Executiv e","Director","Supervisor","Employee","Employee "})

"jalbert1975" wrote:

Tom,
Yes, the COUNTIF does work better than search. Thanks

"jalbert1975" wrote:

Tom,
It seems like my IF statement is case sensitive right now. I will try
adding the asterisks.
How could I do it using LOOKUP so that I could have more than seven search
statements?
Thanks, Jason

"Tom Ogilvy" wrote:

search returns an error if it isn't found, so it might be better to use countif

=IF(COUNTIF(M3,"*president*"),"Executive",IF(COUNT IF(M2,"*ceo*"),"Executive",IF(COUNTIF(M3,"*vp*")," Executive","nothing")))

However, you can only nest if statements 7 deep, so I don't know if this is
going to fill the bill so to speak. (countif is case insensitive)

--
Regards,
Tom Ogilvy




"jalbert1975" wrote:

I've been struggling with a project where I have to take hundreds of
spreadsheets with thousands of contact records. Each record has a field
called "Title" and a field called "Job Function". We have each contact's
specific title, but then we want to categorize them in the "Job Function"
field as an executive, director, supervisor, employee, or faculty. In order
to have to go through and read each title and individually assign a function,
I would like to program an IF or LOOKUP statement combined with a SEARCH
statement to look for key words in the title field and then assign them one
of the function titles. What am I doing wrong here? Right now, I get #VALUE
for any title except for president. I also need to do a lookup table,
because I have more than seven keywords I'd like to search for. Thanks, Jason

Title Function
President President
CEO #VALUE
VP #VALUE

=IF((SEARCH("president",M3)),"Executive",IF((SEARC H("ceo",M3)),"Executive",IF((SEARCH("vp",M3)),"Exe cutive","nothing")))



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default lookup combined with search to find keywords and then assign a

=INDEX({"Executive","Executive","Executive","Direc tor","Supervisor","Supervisor","Employee","Employe e"},MATCH(1,CHOOSE({1,2,3,4,5,6,7,8},COUNTIF(M5,"* president*"),COUNTIF(M5,"*ceo*"),COUNTIF(M5,"*vp*" ),COUNTIF(M5,"*director*"),COUNTIF(M5,"*supervisor *"),COUNTIF(M5,"*manager*"),COUNTIF(M5,"*engineer* "),COUNTIF(M5,"*staff*")),0))

Entered with Ctrl+Shift+Enter. Check the first array - you only had 7
responses to match 8 countifs. I added a Supervisor for Manager, but that
may not be correct.

--
Regards,
Tom Ogilvy


"jalbert1975" wrote:

Ok, so now that I've fixed the search part, how can I nest it in a LOOKUP
statement? Here's what I'm trying that's not working:
LOOKUP(M5,{(COUNTIF(M5,"*president*")),(COUNTIF(M5 ,"*ceo*")),(COUNTIF(M5,"*vp*")),(COUNTIF(M5,"*dire ctor*")),(COUNTIF(M5,"*supervisor*")),(COUNTIF(M5, "*manager*")),(COUNTIF(M5,"*engineer*")),(COUNTIF( M5,"*staff*"))},{"Executive","Executive","Executiv e","Director","Supervisor","Employee","Employee "})

"jalbert1975" wrote:

Tom,
Yes, the COUNTIF does work better than search. Thanks

"jalbert1975" wrote:

Tom,
It seems like my IF statement is case sensitive right now. I will try
adding the asterisks.
How could I do it using LOOKUP so that I could have more than seven search
statements?
Thanks, Jason

"Tom Ogilvy" wrote:

search returns an error if it isn't found, so it might be better to use countif

=IF(COUNTIF(M3,"*president*"),"Executive",IF(COUNT IF(M2,"*ceo*"),"Executive",IF(COUNTIF(M3,"*vp*")," Executive","nothing")))

However, you can only nest if statements 7 deep, so I don't know if this is
going to fill the bill so to speak. (countif is case insensitive)

--
Regards,
Tom Ogilvy




"jalbert1975" wrote:

I've been struggling with a project where I have to take hundreds of
spreadsheets with thousands of contact records. Each record has a field
called "Title" and a field called "Job Function". We have each contact's
specific title, but then we want to categorize them in the "Job Function"
field as an executive, director, supervisor, employee, or faculty. In order
to have to go through and read each title and individually assign a function,
I would like to program an IF or LOOKUP statement combined with a SEARCH
statement to look for key words in the title field and then assign them one
of the function titles. What am I doing wrong here? Right now, I get #VALUE
for any title except for president. I also need to do a lookup table,
because I have more than seven keywords I'd like to search for. Thanks, Jason

Title Function
President President
CEO #VALUE
VP #VALUE

=IF((SEARCH("president",M3)),"Executive",IF((SEARC H("ceo",M3)),"Executive",IF((SEARCH("vp",M3)),"Exe cutive","nothing")))

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
Search formula referencing range of keywords Malvaro Excel Worksheet Functions 5 July 7th 08 03:47 PM
How do I search for keywords in cells containing text? Fredrik Excel Worksheet Functions 4 June 28th 07 01:56 PM
Need Help!! Want to search through 3 columns for a list of keywords The Moose Excel Worksheet Functions 7 January 2nd 07 03:12 AM
Keyword search, several keywords Doman Excel Discussion (Misc queries) 1 July 24th 06 10:58 AM
Search Excel files for text and keywords? quartz[_2_] Excel Programming 4 December 5th 05 08:16 AM


All times are GMT +1. The time now is 07:17 PM.

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

About Us

"It's about Microsoft Excel"