+ Reply to Thread
Results 1 to 7 of 7

Help!! Formula to match text and bring back a related value required! Please Help!!

  1. #1
    Registered User
    Join Date
    09-24-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    3

    Thumbs up Help!! Formula to match text and bring back a related value required! Please Help!!

    Hi all,
    I am need of some help with creating a formula in order to search 2 columns (Columns A and C) for matching data and bring back a value from a third column (Column B). Essentially columns A and B are one table and column C is by itself.
    Please find below an extract of data;

    A B C D
    SUPPLIER NAME SUPPLIER CODE NARRATION REQUIRED OUTCOME (by formula)
    1 AVIS AUSTRALIA 04321 Purchase BestBuys.com
    2 DE NEEFE SIGNS 04407 Purchase Whitcoulls Gallery
    3 RICOH AUSTRALIA 04441 Purchase (NZD 17.36) Whitcoulls Internet Store
    4 ZALLCOM 04444 Purchase Legato Espresso Cafe
    5 LEASE PLAN 04567 Purchase The Stamford Plaza Sydney 04660
    6 STAMFORD PLAZA 04660 Purchase The Stamford Plaza Sydney 04660
    7 DARWIN CITY COUNCIL 04737 Purchase The Stamford Plaza Sydney 04660
    8 TOSHIBA AUSTRALIA PTY LTD 04802 Purchase Profile Publishing
    9 COMPLETE OFFICE SUPPLIES 04823 Purchase Gecko Printing
    10 THOMSON REUTERS 04973 Purchase Stamford Sydney Airport Hotel 05436
    11 STAMFORD SYDNEY AIRPORT HOTEL 05436 Purchase Kwik
    12 TEMPORARY FENCING PTY LTD 05494 Purchase (15.65USD) Ricoh Australia
    13 DEPT FOREIGN AFFAIRS & TRADE 05621
    14 KWIK COPY PRINTING 05675
    15 ADELAIDE CITY COUNCIL 05830
    16 FOUR SEASONS HOTEL SYDNEY 05934
    17 SOUND ADVICE 06233
    18 CREDIT CARD – ONE OFF CREDITORS 99999



    So what I am trying to achieve is;
    I want for each instance of a particular supplier referenced in column C, for a search to be done on column A, and for the corresponding supplier code in column B to be brought back to column D.
    So for example, for ‘Purchase The Stamford Plaza Sydney’ (cell reference C5,C6, and C7) I would like the formula to search column A, find ‘Stamford Plaza’ (cell reference =A6) and place in the relevant cells (cell references = D5, D6 and D7) in column D, supplier code 04660.
    For narrations that do not have a corresponding supplier name in column A, the ‘CREDIT CARD – ONE OF CREDITORS’ supplier should be used, supplier code 99999, e.g. Purchase Whitcoulls Gallery (Cell reference = C2), would produce in D2 99999.
    Columns A and B are a listing out of the finance system and therefore has potentially thousands of values, column C is out of a credit card system and potentially has hundreds of values.
    I have tried using various formulas incorporating wildcards in IF statements, COUNTIF, VLOOKUPS….
    I would be really appreciative of any advice or outcomes that can be offered.
    Thank you in advance 
    :-)

    Cheers,
    Katie

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Help!! Formula to match text and bring back a related value required! Please Help!!

    Hi Katie, welcome to the forum

    Often, a copy/paste to teh forum, does not come out quite as expected - this is 1 of those times

    Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

    In the mean time, take a look at using the INDEX/MATCH function
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-24-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    3

    Re: Help!! Formula to match text and bring back a related value required! Please Help!!

    Hi FDibbins,
    Thanks for the advice.... first time and all....

    Please find attached a file with data as previously discussed. I am trying to determine the correct formula to result in the column D values (in yellow). These should be drawn from column B, based on the matching of columns A and C. Does this make sense?

    As mentioned earlier, columns A and B are from a financial systems Accounts Payable chart and could potentially have thousands of records, and Column C is from a separate credit card system and could potentially have hundreds of transactions/lines.

    PS I hope the attachment of the file has worked...

    Thank you again in advance.
    Attachment 421178
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Help!! Formula to match text and bring back a related value required! Please Help!!

    Thanks for the file.

    A big problem here is that you have a string like "Purchase The Stamford Plaza Sydney", and expect excel to resolve that to "Stamford Plaza" Now, while you or I could fairly easily match or "see" the shorter text string within the larger 1, excel has no such ability. It just sees a string of characters.

    If it was always words 3&4 from a 5 word string, that would be easy, but that is not the case. I could easily drop the "Purchase ", but that still leaves multiple variations...
    Do I always ignore "the"
    how to determine if "Sydney" stays or gets dropped
    etc

    Is there any way you can come up with some "rules" that would make the ID easier?

  5. #5
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Help!! Formula to match text and bring back a related value required! Please Help!!

    even that might be doable - I imagine a loop that checks to see if each of the words in the string that make up "the supplier" are in the narration cell.

    but 'Purchace Kwick' breaks that rule, (because it doesn't have the full name) as I expect may others (probably where words like Ltd are in the name). It looks like there may be no rule to exactly how the narration is formatted...
    Last edited by scottiex; 09-25-2015 at 12:10 AM.

  6. #6
    Registered User
    Join Date
    09-24-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    3

    Re: Help!! Formula to match text and bring back a related value required! Please Help!!

    Hi guys,
    Thanks for your input. What if the narration column only stated, the supplier name or part there of.... and a substitute formula was entered over the top to eradicate instances of "The" at the beginning?

    Is there no way for a wildcard to find matching text within the string? Even if it is not complete ie. find "Kwik" within "Kwik Copy Printing " to bring back "5675".

    Outside of this, have you got any suggestions as to how I could make this possible? Could you please demonstrate how the index/match function would work if all data was 'easier'?

    Sorry for being a pain, just been trying to work this out for a while now. Essentially I am trying to device a general journal format template for easy upload into a finance system.

    Thanks again.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Help!! Formula to match text and bring back a related value required! Please Help!!

    Thing is, you can find "Stamford Plaza" in "Purchase The Stamford Plaza Sydney", but it is a lot more difficult to find something in "Purchase The Stamford Plaza Sydney" that might match "Stamford Plaza".

    Kind of like this...
    A
    B
    C
    2
    aabb
    1
    ad
    3
    aacc
    2
    3
    4
    aadd
    3
    5
    aaee
    4

    C2 is what yuu want to find
    C3=INDEX($B$2:$B$5,MATCH("*"&C2&"*",$A$2:$A$5,0))

+ 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. Array Formula Lookup - Bring back Lowest Date + Bring Back Cell Location
    By Matt1998 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-04-2014, 12:08 PM
  2. [SOLVED] IF Formula required to bring back specific answers
    By karimel_romeo in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-14-2013, 09:43 AM
  3. Replies: 2
    Last Post: 05-15-2012, 10:46 PM
  4. Match two cells and bring back the results from a third
    By amyj22x3 in forum Excel General
    Replies: 3
    Last Post: 10-28-2011, 12:50 PM
  5. Replies: 2
    Last Post: 09-08-2011, 07:08 AM
  6. Match multiple columns to bring back one result
    By amyj22x3 in forum Excel General
    Replies: 3
    Last Post: 08-22-2011, 03:04 PM
  7. Look in another sheet match & bring data back
    By gill389 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2011, 01:56 PM

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