+ Reply to Thread
Results 1 to 7 of 7

How to lookup a partial text string

  1. #1
    Registered User
    Join Date
    12-07-2016
    Location
    Holland
    MS-Off Ver
    2016
    Posts
    2

    Question How to lookup a partial text string

    I download my bankstatement lines and want to automatically link them to categories. I'm lazy, don't want to manually apply them.

    bankstatement-description lines look like this:

    "withdrawal from cash machine 7/12/2016"
    "pin payment in supermarket 7/12/2016"
    "health insurance for december"
    "payment of salary dec16"
    etc.

    I have a table in Excel for the categories, based on specific words in the description:
    searchword - category
    withdrawal - daily expenses
    cash machine - daily expenses
    supermarket - shopping
    health insurance - insurance
    salary - salary

    Now I want a new column in my download table which compares the description field with the category table. I was trying the vlookup and search functions, but couldn't figure it out. Hope you can!

    Thanks,
    Johan

  2. #2
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: How to lookup a partial text string

    Might use =SUMIF. . .surround your category names with asterisks: *withdrawal*, allowing for additional text in your lookup range.
    Pete

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

    Re: How to lookup a partial text string

    Hi

    Considere A2:B7 a table with (searchword, category) where row 2 are labels
    Also considere E3:E10000 the bankstatement

    Use this formula in F3 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    See the file
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,909

    Re: How to lookup a partial text string

    Or try this ...

    =IFERROR(LOOKUP(2,1/COUNTIF(E3,"*"&$A$3:$A$7&"*"),$B$3:$B$7),"")

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to lookup a partial text string

    Or try this ...

    Data Range
    A
    B
    C
    D
    E
    1
    Transaction
    Category
    ------
    Searchword
    Category
    2
    withdrawal from cash machine 7/12/2016
    daily expenses
    withdrawal
    daily expenses
    3
    pin payment in supermarket 7/12/2016
    shopping
    cash machine
    daily expenses
    4
    health insurance for december
    insurance
    supermarket
    shopping
    5
    payment of salary dec16
    salary
    health insurance
    insurance
    6
    salary
    salary


    This formula entered in B2 and copied down:

    =IFERROR(LOOKUP(1000,SEARCH(D$2:D$6,A2),E$2:E$6),"")

    You may have to replace the commas with semi-colons:

    =IFERROR(LOOKUP(1000;SEARCH(D$2:D$6;A2);E$2:E$6);"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    12-07-2016
    Location
    Holland
    MS-Off Ver
    2016
    Posts
    2

    Thumbs up Re: How to lookup a partial text string

    Thanks a lot for the quick and working functions!
    Enjoy your weekend,
    Johan

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to lookup a partial text string

    You're welcome. Thanks for the feedback!

+ 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. Partial lookup from text string, return value from lookup list
    By TotallyLost in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-13-2016, 12:14 PM
  2. Partial Text String Lookup from a List
    By lookingforhelp1 in forum Excel General
    Replies: 5
    Last Post: 01-14-2016, 09:15 AM
  3. [SOLVED] Partial string lookup
    By jprobst in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-14-2015, 08:06 PM
  4. [SOLVED] Lookup Partial String Matches
    By rtabaldi in forum Excel General
    Replies: 5
    Last Post: 04-02-2014, 09:40 PM
  5. Partial String Lookup between two lists of Data
    By rileyfairs in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-12-2014, 06:05 PM
  6. [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

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