+ Reply to Thread
Results 1 to 13 of 13

search text within a cell and vlookup

  1. #1
    Registered User
    Join Date
    12-16-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    6

    Red face search text within a cell and vlookup

    Hi

    This is my first post.
    Apologies if I am being dumb.

    I just need a formula which can search in a table for "CSH" and do a lookup of the data in that row
    I mean: I want to search for cell that contains text "CSH" in Column D and vlookup all the data in that row in another sheet

    I have attached the excel sheet for your reference
    Below is the screenshot as well
    Untitled.png

    Is there a formula which can do a vlookup accordingly?

    Thank you
    Attached Files Attached Files

  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,946

    Re: search text within a cell and vlookup

    Hi and welcome to the forum

    You have a number of entries with CSH in them. VLOOKUP() will only return the 1st "find" and will then stop looking. Also, VLOOKUP() need to search to the right of the criteria column

    Do you want to return ALL entries with CSH in them? IF so, you can do this easily by applying filters and doing a text filter "contains" CSH. If needed, the resulting rows can be copy/pasted onto the new sheet
    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
    12-16-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: search text within a cell and vlookup

    Hi Ford

    Thank you for a quick response

    The excel sheet given is a bank statement where I want to segregate transactions like cash withdrawals, internet transfers, etc in individual sheets like Cash Withdrawal, Internet Transfer, etc.
    I do this manually by copy pasting the transaction to the relevant sheets, however as I am maintaining this from a year, I am looking for something like this:
    Copy paste the statement in the excel sheet
    with the formulas I need, it should keep on adding the transaction to the relevant sheets with all the details

    Is there a possibility for a formula using search and vlookup or hlookup formula?

  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,946

    Re: search text within a cell and vlookup

    see if the attached will get you headed in the right direction. I noticed that you have entries with "NABATM CSH 05th18:35PARAMOUNT CENTRE" and another 1 with "CSHF852561 Church Street Gy"
    Is the CSH with a space either side the same as the 1 with no spaces?

    If you dont want to pull in the 1 with no spaces, adjust the helper column formula to...
    "CSH "
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-16-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: search text within a cell and vlookup

    Hi Ford

    This is amazing ! Never knew this formula, Thank you !!

    The formula you have entered in Sheet 1 would only work for "CSH ", is that correct?
    Do I have add columns for each of the Searches like Internet Transfer, etc?

    Is there anything which can formulate on a separate sheet, keeping the data sheet intact with no formulas?

    Thank you

  6. #6
    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,946

    Re: search text within a cell and vlookup

    I have made a few adjustments to the file I sent you. It now contains a header on sheet 1, and I have added 2 more categories. If you change the header (eg CSH), it changes the data that gets counted. I have also added a few extra sheets, and set them up to pull from each of the 3 helper columns.

    IF you need more sheets, 1st add/copy extra helper columns/formulas. Then add extra sheets, and copy the formulas across from 1 of the other sheets (eg CSH) - and adjust the 1st MATCH() to refer to the new hepler column. For instance, I changed...
    =IFERROR(INDEX(Sheet1!$A:$D,MATCH(ROWS($A$1:A1),Sheet1!$H:$H,0),MATCH(CSH!A$1,Sheet1!$A$2:$D$2,0)),"")
    to this, for the next column and sheet...
    =IFERROR(INDEX(Sheet1!$A:$D,MATCH(ROWS($A$1:A1),Sheet1!$I:$I,0),MATCH(CSH!A$1,Sheet1!$A$2:$D$2,0)),"")

    You can hide the helper columns, or move them way out of the way if you want
    Attached Files Attached Files

  7. #7
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,372

    Re: search text within a cell and vlookup

    If you looking for partial lookup, like lookup for "CSH" or "INTERNET TRANSFER" or anything that avalaible on the lookup table and return value from Column D

    try this

    Azumi
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,625

    Re: search text within a cell and vlookup

    Pl see attached file with Array Formula in Sheet2 A2 and dragged across.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-16-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    6

    Thumbs up Re: search text within a cell and vlookup

    Hi Ford

    Thank you for the resolution
    You are absolutely amazing :-)

    Thank you

  10. #10
    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,946

    Re: search text within a cell and vlookup

    aahh thank you for the kind words, always appreciated

    Happy to help and looking forward to assisting you with your next question

  11. #11
    Registered User
    Join Date
    12-16-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: search text within a cell and vlookup

    Hi Ford

    Sorry to be a pain
    Unfortunately using the same formula by increasing the cell references, I aint getting any results.
    I am definitely doing something wrong, however don't know what?

    I have attached the excel sheet where I was practicing. The search count works fine, but doesn't add the rows in Sheet2.
    Can you also check what is wrong with the Cash Withdrawal sheet?

    I know I may be asking too much, but can you write a sentence explaining what the formula does? this would help me to understand it better.
    I am unsure if I have to open the thread, hence kept it closed.

    Thank you
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-16-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: search text within a cell and vlookup

    Apologies ! I guess I had to open the thread for you to respond

  13. #13
    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,946

    Re: search text within a cell and vlookup

    See the attached. I have corrected CASH W/D sheet, not really sure what you wanted on sheet2, so I didnt touch that 1.

    Also, you have 2013 (.xlsx), but you uploaded a .xls this time. Not sure why you selected to downgrade, but there are some functions I have used that are not compatible with .xls. If you still want to use that version (pre-2007), let me know and I will modify the formulas I used
    Attached Files Attached Files

+ 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. IF(count(search) Function not working when search from text from a cell
    By joshnathan in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-09-2013, 05:13 AM
  2. Replies: 3
    Last Post: 06-17-2013, 01:09 PM
  3. How to combine vlookup and search text within cell
    By garriebartolome in forum Excel General
    Replies: 3
    Last Post: 04-14-2011, 09:43 AM
  4. Search word within Cell (Vlookup+Search)
    By Amarjeet Singh in forum Excel General
    Replies: 6
    Last Post: 01-30-2009, 10:26 AM
  5. How do I use VLOOKUP to search for text?
    By Gman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2005, 08:10 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