+ Reply to Thread
Results 1 to 11 of 11

Help with searching for text and then displaying it.

  1. #1
    Registered User
    Join Date
    04-01-2019
    Location
    Chicago
    MS-Off Ver
    Excel 365
    Posts
    7

    Unhappy Help with searching for text and then displaying it.

    Is there a certain formula or function that can help with searching a bunch of columns until the columns stop and then making a new column with that text that is found? I need to search for different versions of the text, too.

    Here is an example.
    "CAP CER 0.1UF 50V Y5V 0603" I need to find the text "0603" in this cell.
    "DIODE ZENER 2.2V 250MW SOD323" I need to find the text "SOD323" in this cell. But sometimes it might be SOD-323. Also it needs to check for "0603" as well.
    I tried making a whole bunch of nested IF statements but there are so many that I need to search for that the statement is getting too long. Is there a way to check it against a table I make in another spreadsheet with all the terms I need to search for? What would be the best method to approach this? I tried to record a Macro but that only records me pasting my clipboard and not pasting this code.
    Here is my formula so far: =IF(ISNUMBER(SEARCH("0603",H2)),"0603",IF(ISNUMBER(SEARCH("0805",H2)),"0805",IF(ISNUMBER(SEARCH("1206",H2)),"1206",IF(ISNUMBER(SEARCH("2917",H2)),"2917",IF(ISNUMBER(SEARCH("0402",H2)),"0402",IF(ISNUMBER(SEARCH("0201",H2)),"0201",IF(ISNUMBER(SEARCH("1210",H2)),"1210",IF(ISNUMBER(SEARCH("SOT23",H2)),"SOT23",IF(ISNUMBER(SEARCH("SOD123",H2)),"SOD123",IF(ISNUMBER(SEARCH("CONN",H2)),"CONN",IF(ISNUMBER(SEARCH("SOT-23",H2)),"SOT-23",IF(ISNUMBER(SEARCH("tssop",H2)),"TSSOP",IF(ISNUMBER(SEARCH("8SOIC",H2)),"8SOIC",IF(ISNUMBER(SEARCH("14SOIC",H2)),"14SOIC",IF(ISNUMBER(SEARCH("2220",H2)),"2220",IF(ISNUMBER(SEARCH("HC-49/US",H2)),"HC-49/US",IF(ISNUMBER(SEARCH("QFN",H2)),"QFN",IF(ISNUMBER(SEARCH("2512",H2)),"2512",IF(ISNUMBER(SEARCH("8-SOIC",H2)),"8-SOIC","Not Found")))))))))))))))))))


    Please help.
    Thanks in advance.
    Attached Files Attached Files
    Last edited by blizzcane; 04-08-2019 at 01:00 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Help with searching for text and then displaying it.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    04-01-2019
    Location
    Chicago
    MS-Off Ver
    Excel 365
    Posts
    7

    Re: Help with searching for text and then displaying it.

    Hi, I am not able to add any attachements. I am using the latest version of Chrome and all the attachment button does is open an empty drop down.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,855

    Re: Help with searching for text and then displaying it.

    The paperclip icon does not work. Please follow the directions in the last line in post #2.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    04-01-2019
    Location
    Chicago
    MS-Off Ver
    Excel 365
    Posts
    7

    Re: Help with searching for text and then displaying it.

    Thank you, I have uploaded the files I am currently working on. The Sample.xlsm references the table in Footprint.xlsx. I need the "Quantity" column in Sample.xlsm to multiply by a number that I will write in later. The result needs to be at least the amount in the "6in. Min" column or it needs to add "2in extra" column to the result and it is all based on which footprint is found in the "Description" column. For example, if the footprint is 0603, and I need 15 assemblies, For line item 2: 38*15+"2in.min(33)"=603. Check what the minimum is in the table; the min. required is 100 so 603 is good. If it was 38 * 1+33= 72, that is less than 100, so final total should be 100.

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help with searching for text and then displaying it.

    Paste this Code in to a Macro Module

    Please Login or Register  to view this content.
    Change the formula in cell J2 to =FP(H2)

    Change the formula in cell K2 to =IF(J2<>"",VLOOKUP($J$2,$M$2:$Q$28,4,TRUE),"")
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  7. #7
    Registered User
    Join Date
    04-01-2019
    Location
    Chicago
    MS-Off Ver
    Excel 365
    Posts
    7

    Re: Help with searching for text and then displaying it.

    Thank you for the macro. Unfortunately I'm new to macros so I'm not sure If I just add this code before a pre-made macro before the Sub(). I tried that and nothing happened. Cells J2 and K2 say #NAME?. Can you explain what the code is doing? Thanks in advance. I've attached the file.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help with searching for text and then displaying it.

    I found the Macro in 3 places.

    I deleted two occurrences and it now works.

    This adds a user defined function to your workbook.

    The function is explained below:=


    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-01-2019
    Location
    Chicago
    MS-Off Ver
    Excel 365
    Posts
    7

    Re: Help with searching for text and then displaying it.

    Thank you so much for helping me so far. I still am having issues. There is 1 macro in the workbook "Macro2". Is this what I run? It just puts out the formula that I used to have. How do I run this function code instead? I really appreciate this.

  10. #10
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help with searching for text and then displaying it.

    the formula =FP(H2) runs the macro.

    When you fill it down it will run the same macro for each cell eg =FP(H3)

  11. #11
    Registered User
    Join Date
    04-01-2019
    Location
    Chicago
    MS-Off Ver
    Excel 365
    Posts
    7

    Re: Help with searching for text and then displaying it.

    I was just about to say that I figured it out . Thank you. I just had to google user defined function. Is there a way to make this into a macro that runs across each row of the table automatically instead of dragging down the fill option? As well as for the K2 formula?

    I tried to work on my final formula with the FP function and the Vlookup but the formula is not working correctly(inside column L). Some of the results are the opposite of the argument. I can workout why that is later but can you please incorporate this formula into a macro? This is the endgame that I am going for. It needs to take the number under the assemblies and multiply the column that contains "Quantity" by itself and add the Vlookup result in column 5 and compare it to the minimum in column 4 to decide which is higher and paste that number, all with a click of a Macro.
    Attached Files Attached Files
    Last edited by blizzcane; 04-08-2019 at 06:15 PM.

+ 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. Searching, displaying and returning a value
    By Anne_123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2013, 01:28 PM
  2. Need help in searching certain keywords from a array and displaying them
    By hone in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-16-2013, 03:28 PM
  3. Searching and displaying values
    By cikaybe in forum Excel General
    Replies: 1
    Last Post: 07-08-2011, 07:22 AM
  4. Searching tables and displaying results
    By wonderdunder in forum Excel General
    Replies: 7
    Last Post: 02-25-2011, 02:05 PM
  5. Searching a string of text and displaying it's corresponding value
    By ole_gunner11 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-16-2010, 07:46 AM
  6. Searching & Displaying data
    By greekboyuk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2010, 01:56 PM
  7. Searching and displaying the result using VBA
    By kevinhd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2005, 04:12 AM
  8. Replies: 2
    Last Post: 01-04-2005, 09:19 AM

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