+ Reply to Thread
Results 1 to 2 of 2

create text string: "NOT "[b2value]", NOT "[b3value]", ..., NOT "[b600value]"

  1. #1
    Registered User
    Join Date
    08-14-2014
    Location
    SF, USA
    MS-Off Ver
    2010
    Posts
    1

    create text string: "NOT "[b2value]", NOT "[b3value]", ..., NOT "[b600value]"

    I want to do an advanced search of a database using keywords that produce many results. To make the results more manageable, I want to filter out the results that I have already recorded in my existing worksheet, "Data".

    Data!D1 is a header, "FirstLast", with a reference list in D (list is of first and last names). Formula in D2 =CONCATENATE(B2, " ", C2) which I copied down to D969. Entries in D are not all unique (though some are); some names appear several times.

    See attachment for illustration. Described further:
    Goal1: I want to generate a list of all unique D values (i.e. ignores duplicates) in Column B of a new sheet, "Summary", in the same workbook.
    My attempt:
    B2 =INDEX($A$2:$A$969, MATCH(0, COUNTIF($B$1:B1,$A$2:$A$969), 0))
    But that returns #N/A in B2 after pressing ctrl+shift+enter.

    Goal2: I want to generate a single string of text showing all Summary!B values in quotes, each with 'NOT ' preceding it and with a comma directly following the endquote. (I want to copy this text into a database search so that I can filter out results already in my spreadsheet.) Basically, I want a formula that will produce text like this, all in one cell:
    NOT "[B2Text]", NOT "[B3Text]", NOT "[EBText]", ... , NOT "[LastBEntryText]"


    My guess is it is something like: =CONCATENATE(“NOT “”, B2, “”, ”, “NOT “”, B3, “”, ”, “NOT “”, B4, “”, ”, ...B?[End of my List #])

    BUT how do I do this for the whole range so I don’t have to manually type B2-B6235484 in the formula? Also, I think getting quotes to appear is an issue for me

    See attachment for illustration
    Attached Files Attached Files
    Last edited by savekels; 08-15-2014 at 05:16 AM.

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

    Re: create text string: "NOT "[b2value]", NOT "[b3value]", ..., NOT "[b600value]"

    Quote Originally Posted by savekels View Post
    Goal1: I want to generate a list of all unique D values (i.e. ignores duplicates) in Column B of a new sheet, "Summary", in the same workbook.
    My attempt:
    B2 =INDEX($A$2:$A$969, MATCH(0, COUNTIF($B$1:B1,$A$2:$A$969), 0))
    Hi. Not sure I understand. Both your above formula and the expected results in your attached appear to be asking for values from either the First or Last column, and not from the FirstLast column (though this is the column you seem to be indicating in your explanation above).

    Quote Originally Posted by savekels View Post
    [B]Goal2:I want a formula that will produce text like this, all in one cell:
    NOT "[B2Text]", NOT "[B3Text]", NOT "[EBText]", ... , NOT "[LastBEntryText]"
    Unfortunately there is no array version of CONCATENATE which would allow this process to be shortened. In a nutshell, unless you incorporate some VBA then you will have no alternative but to write an extremely long and unwieldy formula such as you give, and obviously if the number of strings to be concatenated could be quite large then this is simply not feasible.

    Regards
    Click * below if this answer helped

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

+ 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] Macro/s to create Search Bar to filter to search terms entered activated by Command Button
    By JasonRay in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2013, 03:44 PM
  2. Using a Macro to search though a database and display the results on a new sheet
    By tmbg99 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-07-2013, 05:34 PM
  3. Replies: 33
    Last Post: 01-10-2006, 02:30 AM
  4. Replies: 34
    Last Post: 01-10-2006, 02:30 AM
  5. [SOLVED] searching a large database with a long list of search terms
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 01-10-2006, 02:30 AM

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