Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Nested if text search

I have entered the following formula in my spreadsheet. There are about 100
different text strings in column A that I can categorize based on certain
sub-strings. Creating these categories in the data will make the pivot
tables easier to create later. Here's my formula:

=IF(NOT(ISERR(SEARCH("String1",A4))),"String1",
IF(NOT(ISERR(SEARCH("String2",A4))),"String2",
IF(NOT(ISERR(SEARCH("String3",A4))),"String3",
IF(NOT(ISERR(SEARCH("String4",A4))),"String4",
IF(NOT(ISERR(SEARCH("String5",A4))),"String5","Non e of the Above")))))

This formula works like a charm. However, there is one other string, call
it "String6", I need to include. The following formula does not work:

=IF(NOT(ISERR(SEARCH("String1",A4))),"String1",
IF(NOT(ISERR(SEARCH("String2",A4))),"String2",
IF(NOT(ISERR(SEARCH("String3",A4))),"String3",
IF(NOT(ISERR(SEARCH("String4",A4))),"String4",
IF(NOT(ISERR(SEARCH("String5",A4))),"String5",
IF(NOT(ISERR(SEARCH("String6",A4))),"String6","Non e of the Above"))))))

Excel seems to have a problem with ISERR in the final nested IF. I can
split the formula up into multiple columns, but that's not as elegant as I'd
like it to be. Am I doing something wrong?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default Nested if text search

=IF(ISNUMBER(SEARCH("String",A4)),MID(A4,SEARCH("S tring",A4),7),"None of the
Above")


"jims2994" wrote:

I have entered the following formula in my spreadsheet. There are about 100
different text strings in column A that I can categorize based on certain
sub-strings. Creating these categories in the data will make the pivot
tables easier to create later. Here's my formula:

=IF(NOT(ISERR(SEARCH("String1",A4))),"String1",
IF(NOT(ISERR(SEARCH("String2",A4))),"String2",
IF(NOT(ISERR(SEARCH("String3",A4))),"String3",
IF(NOT(ISERR(SEARCH("String4",A4))),"String4",
IF(NOT(ISERR(SEARCH("String5",A4))),"String5","Non e of the Above")))))

This formula works like a charm. However, there is one other string, call
it "String6", I need to include. The following formula does not work:

=IF(NOT(ISERR(SEARCH("String1",A4))),"String1",
IF(NOT(ISERR(SEARCH("String2",A4))),"String2",
IF(NOT(ISERR(SEARCH("String3",A4))),"String3",
IF(NOT(ISERR(SEARCH("String4",A4))),"String4",
IF(NOT(ISERR(SEARCH("String5",A4))),"String5",
IF(NOT(ISERR(SEARCH("String6",A4))),"String6","Non e of the Above"))))))

Excel seems to have a problem with ISERR in the final nested IF. I can
split the formula up into multiple columns, but that's not as elegant as I'd
like it to be. Am I doing something wrong?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Nested if text search

That worked, and it's cleaner, too. Still not sure why my formula didn't
work, but I'm not going to lose sleep over it. Thanks.

"Teethless mama" wrote:

=IF(ISNUMBER(SEARCH("String",A4)),MID(A4,SEARCH("S tring",A4),7),"None of the
Above")


"jims2994" wrote:

I have entered the following formula in my spreadsheet. There are about 100
different text strings in column A that I can categorize based on certain
sub-strings. Creating these categories in the data will make the pivot
tables easier to create later. Here's my formula:

=IF(NOT(ISERR(SEARCH("String1",A4))),"String1",
IF(NOT(ISERR(SEARCH("String2",A4))),"String2",
IF(NOT(ISERR(SEARCH("String3",A4))),"String3",
IF(NOT(ISERR(SEARCH("String4",A4))),"String4",
IF(NOT(ISERR(SEARCH("String5",A4))),"String5","Non e of the Above")))))

This formula works like a charm. However, there is one other string, call
it "String6", I need to include. The following formula does not work:

=IF(NOT(ISERR(SEARCH("String1",A4))),"String1",
IF(NOT(ISERR(SEARCH("String2",A4))),"String2",
IF(NOT(ISERR(SEARCH("String3",A4))),"String3",
IF(NOT(ISERR(SEARCH("String4",A4))),"String4",
IF(NOT(ISERR(SEARCH("String5",A4))),"String5",
IF(NOT(ISERR(SEARCH("String6",A4))),"String6","Non e of the Above"))))))

Excel seems to have a problem with ISERR in the final nested IF. I can
split the formula up into multiple columns, but that's not as elegant as I'd
like it to be. Am I doing something wrong?

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
Fun with text functions - search for text mr tom Excel Worksheet Functions 7 October 26th 07 07:17 PM
Search, find or lookup defined text in text string zzxxcc Excel Worksheet Functions 9 September 6th 07 09:37 PM
Limit to nested IF(ISNUMBER(SEARCH)) functions? Jonathan Horvath Excel Worksheet Functions 22 June 25th 07 08:04 PM
Can COUNTIF be nested to search two ranges Jimbob Excel Worksheet Functions 4 November 1st 06 05:23 PM
Returning text from nested IF and Vlookup statements Patricia Excel Worksheet Functions 10 July 28th 06 04:22 PM


All times are GMT +1. The time now is 02:16 AM.

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"