Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Search multiple text in one string

Greetings,

I have a pivot table where the first column holds the string to search
(first value in E21)


Airfare Account
AirFare Transactions
Car Rental
Meals & Incidentals



I have a table of 12 categories with about 3 keywords each:

Pick List: Keywords:
D E F G
3 Travel - Per Diem Diem lodging diem
4 Travel - Rental Car car mileage Ground trans
5 Travel - Airfare Air air Fare
6 Travel - Other travel


D21 (cell to the left of pivot table value) should automatically categorize
the item. Find is case sensitive, Search worked better...

This is what I have on D21:
=IFERROR(IF(SEARCH(OR($E$3,$F$3,$G$3),E21),$D$3,"c ontinue with next
keywords"),$D$14)
OR- Doesn't work on multiple search or find. Not sure how to do it in VBA.
Brain freeze Help..please :) Different/faster/better solutions also welcome.

Thanks,
Pilar
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Search multiple text in one string

Pilar,

How about different AND better.... Simply make a table with the unique keywords listed down a
column, and then categorize them:

Keywords Category
Per Diem 3 Travel
Diem Lodging 3 Travel
Diem 3 Travel
etc, etc

Then use VLOOKUP to pick up the category (use false as the 4th argument to force an exact match)

HTH,
Bernie
MS Excel MVP


"Pilar Morales" wrote in message
...
Greetings,

I have a pivot table where the first column holds the string to search
(first value in E21)


Airfare Account
AirFare Transactions
Car Rental
Meals & Incidentals



I have a table of 12 categories with about 3 keywords each:

Pick List: Keywords:
D E F G
3 Travel - Per Diem Diem lodging diem
4 Travel - Rental Car car mileage Ground trans
5 Travel - Airfare Air air Fare
6 Travel - Other travel


D21 (cell to the left of pivot table value) should automatically categorize
the item. Find is case sensitive, Search worked better...

This is what I have on D21:
=IFERROR(IF(SEARCH(OR($E$3,$F$3,$G$3),E21),$D$3,"c ontinue with next
keywords"),$D$14)
OR- Doesn't work on multiple search or find. Not sure how to do it in VBA.
Brain freeze Help..please :) Different/faster/better solutions also welcome.

Thanks,
Pilar



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Search multiple text in one string

Bernie, thank you for your reply. Does this mean I need to create 48 (12X4)
VLOOKUPs nested in 12 IF functions? I'm not sure how to implement your
solution...

I'm searching for the keywords on table, which are then found in the first
column of a pivot table.

Thank you for your help,
Pilar

"Bernie Deitrick" wrote:

Pilar,

How about different AND better.... Simply make a table with the unique keywords listed down a
column, and then categorize them:

Keywords Category
Per Diem 3 Travel
Diem Lodging 3 Travel
Diem 3 Travel
etc, etc

Then use VLOOKUP to pick up the category (use false as the 4th argument to force an exact match)

HTH,
Bernie
MS Excel MVP


"Pilar Morales" wrote in message
...
Greetings,

I have a pivot table where the first column holds the string to search
(first value in E21)


Airfare Account
AirFare Transactions
Car Rental
Meals & Incidentals



I have a table of 12 categories with about 3 keywords each:

Pick List: Keywords:
D E F G
3 Travel - Per Diem Diem lodging diem
4 Travel - Rental Car car mileage Ground trans
5 Travel - Airfare Air air Fare
6 Travel - Other travel


D21 (cell to the left of pivot table value) should automatically categorize
the item. Find is case sensitive, Search worked better...

This is what I have on D21:
=IFERROR(IF(SEARCH(OR($E$3,$F$3,$G$3),E21),$D$3,"c ontinue with next
keywords"),$D$14)
OR- Doesn't work on multiple search or find. Not sure how to do it in VBA.
Brain freeze Help..please :) Different/faster/better solutions also welcome.

Thanks,
Pilar




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Search multiple text in one string

Bernie, thank you for your reply. Does this mean I need to create 48 (12X4)
VLOOKUPs nested in 12 IF functions? I'm not sure how to implement your
solution...


No. You would use one IF/VLOOKUP combination along the lines of

=IF(E21<"",VLOOKUP(E21,Table,2,False),"")

Where table is the address of your new table, like $H$1:$I$45

So, if "Per Diem" is in E21, the formula would return "3 Travel"

Note, that it is better if you type the formula in directly rather than click on the cell in the
pivot table to create a link: that will fire the GetPivotData, which doesn't copy well...

HTH,
Bernie
MS Excel MVP



I'm searching for the keywords on table, which are then found in the first
column of a pivot table.

Thank you for your help,
Pilar

"Bernie Deitrick" wrote:

Pilar,

How about different AND better.... Simply make a table with the unique keywords listed down a
column, and then categorize them:

Keywords Category
Per Diem 3 Travel
Diem Lodging 3 Travel
Diem 3 Travel
etc, etc

Then use VLOOKUP to pick up the category (use false as the 4th argument to force an exact match)

HTH,
Bernie
MS Excel MVP


"Pilar Morales" wrote in message
...
Greetings,

I have a pivot table where the first column holds the string to search
(first value in E21)


Airfare Account
AirFare Transactions
Car Rental
Meals & Incidentals



I have a table of 12 categories with about 3 keywords each:

Pick List: Keywords:
D E F G
3 Travel - Per Diem Diem lodging diem
4 Travel - Rental Car car mileage Ground trans
5 Travel - Airfare Air air Fare
6 Travel - Other travel


D21 (cell to the left of pivot table value) should automatically categorize
the item. Find is case sensitive, Search worked better...

This is what I have on D21:
=IFERROR(IF(SEARCH(OR($E$3,$F$3,$G$3),E21),$D$3,"c ontinue with next
keywords"),$D$14)
OR- Doesn't work on multiple search or find. Not sure how to do it in VBA.
Brain freeze Help..please :) Different/faster/better solutions also welcome.

Thanks,
Pilar






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Search multiple text criteria in one string - Help?

Bernie, I think I know where the confusion is.. Hear me out...
I need to find the keyword (in table) inside the text in E21 first.

E21 (or in the whole E column values) may say something like: "AirFare
transactions" or "Direct Travel" or "other non-travel"(which is not travel,
but that's another story...

It would look something like: (of course this won't work...)

=IF(ColumnEitem<"",VLOOKUP(AllKeywordsinCcol,
ColumnEpivotItem,returnmyCategoryinDcol,False),"")

Should I post a new thread, and try to explain the situation better? Not
sure where it's ambiguous... except I'm not looking at exact matches, but
text (keyword) within larger text (in E21+column) so I can apply a category
that will update once the pivot table is updated.

Maybe 48 nested IF statements won't be so bad... How many can 2007 handle?

Thank you for your time,
Pilar

"Bernie Deitrick" wrote:

Bernie, thank you for your reply. Does this mean I need to create 48 (12X4)
VLOOKUPs nested in 12 IF functions? I'm not sure how to implement your
solution...


No. You would use one IF/VLOOKUP combination along the lines of

=IF(E21<"",VLOOKUP(E21,Table,2,False),"")

Where table is the address of your new table, like $H$1:$I$45

So, if "Per Diem" is in E21, the formula would return "3 Travel"

Note, that it is better if you type the formula in directly rather than click on the cell in the
pivot table to create a link: that will fire the GetPivotData, which doesn't copy well...

HTH,
Bernie
MS Excel MVP



I'm searching for the keywords on table, which are then found in the first
column of a pivot table.

Thank you for your help,
Pilar

"Bernie Deitrick" wrote:

Pilar,

How about different AND better.... Simply make a table with the unique keywords listed down a
column, and then categorize them:

Keywords Category
Per Diem 3 Travel
Diem Lodging 3 Travel
Diem 3 Travel
etc, etc

Then use VLOOKUP to pick up the category (use false as the 4th argument to force an exact match)

HTH,
Bernie
MS Excel MVP


"Pilar Morales" wrote in message
...
Greetings,

I have a pivot table where the first column holds the string to search
(first value in E21)


Airfare Account
AirFare Transactions
Car Rental
Meals & Incidentals



I have a table of 12 categories with about 3 keywords each:

Pick List: Keywords:
D E F G
3 Travel - Per Diem Diem lodging diem
4 Travel - Rental Car car mileage Ground trans
5 Travel - Airfare Air air Fare
6 Travel - Other travel


D21 (cell to the left of pivot table value) should automatically categorize
the item. Find is case sensitive, Search worked better...

This is what I have on D21:
=IFERROR(IF(SEARCH(OR($E$3,$F$3,$G$3),E21),$D$3,"c ontinue with next
keywords"),$D$14)
OR- Doesn't work on multiple search or find. Not sure how to do it in VBA.
Brain freeze Help..please :) Different/faster/better solutions also welcome.

Thanks,
Pilar








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Search multiple text criteria in one string - Help?

Pilar,

No, 48 nested formulas is not a good idea.

If you make a table that lists at all the possible entries in column E:

"AirFare transactions" or "Direct Travel" or "other non-travel"

becomes a list of valid entries

Valid Entries
AirFare transactions
Direct Travel
other non-travel

That you then categorize

Valid Entries Category
AirFare transactions Travel 1
Direct Travel Travel 2
other non-travel Travel 3


etc.

Then you use VLOOKUP on that table to return Travel 1, Travel 2, Travel 3...

If you allow your users to enter whatever they want in column E, then you will never get it to work.
You can create a huge list of allowable values (the Valid Entries) and use data validation on cells
in columns E to force the user to enter only from that list.

HTH,
Bernie
MS Excel MVP


"Pilar Morales" wrote in message
...
Bernie, I think I know where the confusion is.. Hear me out...
I need to find the keyword (in table) inside the text in E21 first.

E21 (or in the whole E column values) may say something like: "AirFare
transactions" or "Direct Travel" or "other non-travel"(which is not travel,
but that's another story...

It would look something like: (of course this won't work...)

=IF(ColumnEitem<"",VLOOKUP(AllKeywordsinCcol,
ColumnEpivotItem,returnmyCategoryinDcol,False),"")

Should I post a new thread, and try to explain the situation better? Not
sure where it's ambiguous... except I'm not looking at exact matches, but
text (keyword) within larger text (in E21+column) so I can apply a category
that will update once the pivot table is updated.

Maybe 48 nested IF statements won't be so bad... How many can 2007 handle?

Thank you for your time,
Pilar

"Bernie Deitrick" wrote:

Bernie, thank you for your reply. Does this mean I need to create 48 (12X4)
VLOOKUPs nested in 12 IF functions? I'm not sure how to implement your
solution...


No. You would use one IF/VLOOKUP combination along the lines of

=IF(E21<"",VLOOKUP(E21,Table,2,False),"")

Where table is the address of your new table, like $H$1:$I$45

So, if "Per Diem" is in E21, the formula would return "3 Travel"

Note, that it is better if you type the formula in directly rather than click on the cell in the
pivot table to create a link: that will fire the GetPivotData, which doesn't copy well...

HTH,
Bernie
MS Excel MVP



I'm searching for the keywords on table, which are then found in the first
column of a pivot table.

Thank you for your help,
Pilar

"Bernie Deitrick" wrote:

Pilar,

How about different AND better.... Simply make a table with the unique keywords listed down a
column, and then categorize them:

Keywords Category
Per Diem 3 Travel
Diem Lodging 3 Travel
Diem 3 Travel
etc, etc

Then use VLOOKUP to pick up the category (use false as the 4th argument to force an exact
match)

HTH,
Bernie
MS Excel MVP


"Pilar Morales" wrote in message
...
Greetings,

I have a pivot table where the first column holds the string to search
(first value in E21)


Airfare Account
AirFare Transactions
Car Rental
Meals & Incidentals



I have a table of 12 categories with about 3 keywords each:

Pick List: Keywords:
D E F G
3 Travel - Per Diem Diem lodging diem
4 Travel - Rental Car car mileage Ground trans
5 Travel - Airfare Air air Fare
6 Travel - Other travel


D21 (cell to the left of pivot table value) should automatically categorize
the item. Find is case sensitive, Search worked better...

This is what I have on D21:
=IFERROR(IF(SEARCH(OR($E$3,$F$3,$G$3),E21),$D$3,"c ontinue with next
keywords"),$D$14)
OR- Doesn't work on multiple search or find. Not sure how to do it in VBA.
Brain freeze Help..please :) Different/faster/better solutions also welcome.

Thanks,
Pilar








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 If on text string bob Excel Worksheet Functions 3 February 15th 10 06:49 PM
Nested formula to search a text string and return specific text Barbie Excel Worksheet Functions 10 February 21st 09 07:40 AM
Search, find or lookup defined text in text string zzxxcc Excel Worksheet Functions 9 September 6th 07 09:37 PM
How do I do a multiple search using key words in a text string patricia tipp Excel Discussion (Misc queries) 1 February 28th 06 05:01 PM
Search string with multiple criteria fLiPMoD£ Excel Worksheet Functions 2 May 5th 05 08:02 PM


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