+ Reply to Thread
Results 1 to 7 of 7

match long string with spaces against smaller string and return label

  1. #1
    Registered User
    Join Date
    09-04-2019
    Location
    london
    MS-Off Ver
    2000
    Posts
    3

    match long string with spaces against smaller string and return label

    help...

    I've tried index, match, vlookup, sumproduct etc and cant work out how to check the following bank transactions...

    'SANTANDERCARDS LTD **transaction 1
    0207 28AUG19 , RINGGO , RICHMOND GB
    'HALIFAX
    'nuffield health
    '0207 25AUG19 , RINGOPARKBYPHONE , SOUTH WEST TR GB
    'TV LICENCE MBP
    'EE LIMITED
    'LBRUT DIRECT DEBIT
    'BARCLAYS UK MTGES
    'BARCLAYS UK MTGES

    ...against the below list of references and return column B value (e.g. credit card bill, gym, parking) if there is a match.

    col A col B
    SANTANDER Credit Card bill
    nuffield Gym
    RINGGO Parking

    i.e. check transaction 1 against the list and return "credit card bill", then perform the same for the rest of the transactions

    Thanks

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,902

    Re: match long string with spaces against smaller string and return label

    Can you upload sample file? It will be so much easier to help you with it.

    To upload sample file, use "Go Advanced" button, follow "Manage Attachments" hyperlink. It will launch new tab/window for managing uploads.

    I'd imagine you can use something like...
    =LOOKUP(2,1/SEARCH(ColA,TargetLongString),ColB)
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    09-04-2019
    Location
    london
    MS-Off Ver
    2000
    Posts
    3

    Re: match long string with spaces against smaller string and return label

    Hi, uploaded,

    I want to read down the transactions in the 'current*' sheet (column I) and xref to the data in sheet 'ref' and return the value from column B
    if there is a match...

    Thanks.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: match long string with spaces against smaller string and return label

    Try this
    Please Login or Register  to view this content.

  5. #5
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: match long string with spaces against smaller string and return label

    Hi

    I suppose you should use another approach instead of the one you are using.

    If I understand your question, do this:

    In ref!F1 use (and copy down)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In ref!G1 use (and copy down)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In 'Current33035547-20190903 - upd2'!I4 use (and copy down)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    See the file in a new format xlsx
    Attached Files Attached Files

  6. #6
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: match long string with spaces against smaller string and return label

    Hi
    I improved the solution proposal from the previous post and I implemented four solutions. The latest implementation is because it uses summer 2000 which does not support aggregate functions, the formula must be entered with CTRL+SHIFT+ENTER. See and choose the one that suits you best.

    Notes: By necessity, on sheet 'ref' I inserted a starting row, put in B1 a blank space and in column A, since A2:A40 I replaced empty cells with a symbol not used in the description of bank movement.
    See the file
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-04-2019
    Location
    london
    MS-Off Ver
    2000
    Posts
    3

    Re: match long string with spaces against smaller string and return label

    Hi all, I used huuthang_bd's formula and it worked!

    Thanks v much :-)

    PS - thanks also Jose, I'll keep that one for another day.

+ 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. Advanced string manipulation-Adding spaces to a string
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-22-2019, 08:08 PM
  2. Need to return a character found in the middle of a long, long string
    By ACWest in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-25-2019, 03:59 PM
  3. Macro to separate long string of characters and several spaces into separate columns
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-31-2017, 07:37 PM
  4. Replies: 2
    Last Post: 06-07-2015, 08:43 AM
  5. Replies: 2
    Last Post: 12-31-2011, 06:41 AM
  6. Splting a long string, at the spaces, with a max length of 24
    By bassima in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2011, 02:26 AM
  7. Importing Long String - String Manipulation (INVRPT) (EDI EANCOM 96a)
    By Brian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2006, 11:45 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