+ Reply to Thread
Results 1 to 14 of 14

Need help with a search function when returning multiple fields

  1. #1
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Need help with a search function when returning multiple fields

    So I have been working on a workbook that has a search function to return multiple fields. I was wondering if there was a way to differentiate between separate fields using this function if my search returns more than 1 result. Currently it just grabs the information from the first field that is found.

    The example I am posting shows 2 exact same fields (D17 and D18). The search function searches entire D column but if you search for one that has multiple entries, there is currently no way to select or differentiate which one I am actually referring to.

    What I am wondering is, is there a formula that would make it so I could differentiate manually? or would this be something that I need to code using the VBA?

    Thank you in advance!
    Attached Files Attached Files
    Last edited by Jede; 03-02-2020 at 04:07 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Need help with a search function when returning multiple fields

    Using Named ranges instead of entire columns*
    Manufacturer_Item_ID =Sheet1!$D$1:$D$18
    Manufacturer_Name =Sheet1!$C$1:$C$18
    RCM_Item_ID_Barcode =Sheet1!$E$1:$E$18

    *can be made dynamic...

    H13:
    count the number of matches for G13; enter values >1 only
    Please Login or Register  to view this content.
    If multiple matches, then I13 accepts a value from k=1 to #matches. This number is used by SMALL() to return the kth item in the match array.
    G16:
    Please Login or Register  to view this content.
    G17:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Need help with a search function when returning multiple fields

    Hey Proton, thanks for the response! I do get that the search can be made more dynamic using exact cell conditions but herein lies the problem. The actual workbook that these formulas will be going in are roughly 51,000 rows deep and will be constantly adding new cells(hence why I had it searching the entire column) I was just trying to find a solution for if it came back with multiple results without having to re-edit the formula every time a new entry is added.
    Last edited by Jede; 02-17-2020 at 02:14 PM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Need help with a search function when returning multiple fields

    "...the search can be made more dynamic using exact cell conditions...", no, when talking about Excel formulas that's not what dynamic means.

    A dynamic named range is one where the rows/columns are adjusted by Excel without the need for editing due to changes.

    One of the named ranges I gave you was:
    Manufacturer_Item_ID =Sheet1!$D$1:$D$18

    To make Manufacturer_Item_ID dynamic (i.e., self-adjusting), you would use:
    Please Login or Register  to view this content.
    and you will never have to edit/modify it with changes in number of rows in the data.

    The solution I gave you tells you when/if there are multiple occurrences of the search value and lets you choose which you want. Did you try it (I don't know from your last post)?

  5. #5
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Need help with a search function when returning multiple fields

    Thanks for the help proton! It did help in a round-a-bout way, I just have to clean this up as it's a process change with my work(quality manager didn't like the way it looked ). I ended up just splitting all of my duplicates and running the same formulas and scripts in a different workbook. Thank you for your effort though!

  6. #6
    Registered User
    Join Date
    10-15-2019
    Location
    london
    MS-Off Ver
    2016
    Posts
    7

    Re: Need help with a search function when returning multiple fields

    thanks i found it worked for me too

  7. #7
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Need help with a search function when returning multiple fields

    Ok so now they changed their mind and want to do it the first way... When I copied the formula's into my wb it's not returning the correct value for G17 and also the value for G15 disappears . Please help.

    Edit: Also if there are no duplicates I still need it to return the pertinent data. Thank you.
    Attached Files Attached Files
    Last edited by Jede; 02-27-2020 at 05:27 PM.

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Need help with a search function when returning multiple fields

    If only one item is found, cell I13 needs to bel cleared. I added ad data validation to I13.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Need help with a search function when returning multiple fields

    If you type in a different part number it is still not bringing back the correct function in the "Item ID" column to correspond with the correct row for the "manufacturer item id"

  10. #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Need help with a search function when returning multiple fields

    Specific example....

  11. #11
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Need help with a search function when returning multiple fields

    Here is the Example
    Attached Files Attached Files

  12. #12
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Need help with a search function when returning multiple fields

    In the second wkbk I posted, I was returning data from Column B to cell G15. On the one you just posted, it is returning column A. However, it looks like you forgot to commit the *array* formula with Ctrl+shift+enter. When I did, it returned ADH0005 from row 13 vs ADH0007 from row 15.

  13. #13
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Need help with a search function when returning multiple fields

    Yes the info that I need to return is column A in that cell. Still a newbie when it comes to advanced formulations. Thanks so much for the help!

  14. #14
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Need help with a search function when returning multiple fields

    You're welcome

+ 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. [SOLVED] If isnumber search function returning false
    By hawkwolf in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-14-2018, 02:36 PM
  2. Live Search MULTIPLE fields SIMULTANEOUSLY [search as you type]
    By deannaed in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2018, 02:06 PM
  3. [SOLVED] Search Function Not Returning The Expected Results
    By adam_d_john in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-29-2017, 02:40 PM
  4. 2007 Returning data across multiple fields which includes dupe Ids
    By singh84 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-08-2016, 08:40 AM
  5. Create search tool with multiple fields
    By adauria in forum Excel General
    Replies: 9
    Last Post: 01-27-2015, 03:18 PM
  6. Search for multiple fields / columns
    By paulmac66 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-07-2013, 04:47 AM
  7. SEARCH function returning cell ID
    By TraductionW in forum Excel General
    Replies: 4
    Last Post: 01-15-2010, 11:44 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