+ Reply to Thread
Results 1 to 8 of 8

Return a result for the appearance of a text string in any cell in a row (EXCEL 2010)

  1. #1
    Registered User
    Join Date
    01-30-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Return a result for the appearance of a text string in any cell in a row (EXCEL 2010)

    Hello, I deal with a rather large excel database (the range is A1:AV168266) that contains customer information. Some of these various customers are affiliated with a group called "ascend" and I need to be able to filter all my list by every customer affilliated with Ascend. The trouble is that the word "ascend" can appear in 8 different columns and usually when it appears in one column it doesn't appear in the others and their can also be more text in the cell beyond the word "ascend". I want to create a formula that will simply look for the word "ascend" in any cell of a row and return a result I can filter by. I will be putting the formula in column AW and put it in all 170,000 rows of that column, that way I can just filter by a single column.

    I've played around with combining COUNTIF with SEARCH and MATCH with SEARCH but nothing seems to work. Ideas?

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,652

    Re: Return a result for the appearance of a text string in any cell in a row (EXCEL 2010)

    Type it in AW1:
    =SUMPRODUCT(--ISNUMBER(SEARCH("ascend",A1:AV1)))>0
    give TRUE / FALSE if found / not found the word "ascend"
    You can use FIND if the word is case-sensitive.
    Filter the column AW with TRUE.
    Quang PT

  3. #3
    Registered User
    Join Date
    01-30-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Return a result for the appearance of a text string in any cell in a row (EXCEL 2010)

    thanks for the quick response bebo, unfortunately that didn't work. I think the word ascend typically appears in all caps, but I'm not 100% sure of that. Might I also ask what the two hyphens before ISNUMBER mean?

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Return a result for the appearance of a text string in any cell in a row (EXCEL 2010)

    Hi,

    When you say that bebo's solution "didn't work", can you be a bit more specific? What result did you get? What result were you expecting, and why?

    Also, did you amend the range references to match your actual set-up, if necessary?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    01-30-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Return a result for the appearance of a text string in any cell in a row (EXCEL 2010)

    My apologies, bebo's solution works perfectly. The database has been changed. At first I thought it didn't work because there were only 2 true results and there should be several thousand but it turns out all occurrences of this word have been removed (save 2) and a new way of distinguishing these customers was added.

    Thanks so much for the help

    I'm still curious about what the hyphens are for if anyone wouldn't mind answering

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,652

    Re: Return a result for the appearance of a text string in any cell in a row (EXCEL 2010)

    Nice to see it works.
    SUMPRODUCT works with numbers, while ISNUMBER gives TRUE/FALSE. --will converts TRUE/FALSE into 1/0 (Also, numbers store as text into numbers)

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Return a result for the appearance of a text string in any cell in a row (EXCEL 2010)

    Ok. Glad you got it sorted.

    The double-unary, as its known, is actually two 'minus' symbols operating, consecutively, on the array of returns resulting from the SUMPRODUCT. For example, you might have the following return of Boolean responses for each of the cells in A1:AV1 as to whether they contain the string "ascend" (I won't list them all):

    {FALSE,FALSE,FALSE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE,TRUE,FALSE,TRUE,TRUE,FALSE,FALSE,FALSE,TRUE,...}

    Since, effectively, we wish to count the TRUEs as 1 and the FALSEs as 0 (this is precisely how functions like SUMPRODUCT work), we must first coerce them into those (numerical) values. Fortunately, any suitable mathematical operation (i.e one which leaves the value unchanged) applied to a Boolean return of TRUE/FALSE will do just that: TRUE*1 = 1*1 = 1, 1*FALSE = 1*0 = 0, TRUE+0 = 1+0 = 1, etc.

    Multiplying by -1 (putting a single minus sign in front of the array) is another mathematical operation which would coerce the TRUE/FALSE strings into numerical values, though the results would be a string of -1s (for the TRUEs), which would not give the desired results. Hence the second minus sign, which "negates the negation" (and so returns +1s).

    If it's any easier to comprehend, bebo's formula could equally have been written:

    =SUMPRODUCT(0+ISNUMBER(SEARCH("ascend",A1:AV1)))>0

    or

    =SUMPRODUCT(1*ISNUMBER(SEARCH("ascend",A1:AV1)))>0

    Regards

  8. #8
    Registered User
    Join Date
    01-30-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Return a result for the appearance of a text string in any cell in a row (EXCEL 2010)

    excellent. Your responses today will help me beyond this problem. I appreciate it a lot

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Error code 4605 which seems random in appearance - Excel 2010
    By Storm85 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-30-2014, 05:08 PM
  2. [SOLVED] IF range of cells contains string of text, return contents of cell where string is found
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2013, 09:56 AM
  3. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  4. Replies: 6
    Last Post: 05-02-2011, 10:40 AM
  5. Return a text string when the result of VLOOKUP formula is #N/A
    By jeremy nickels in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-04-2006, 12:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1