+ Reply to Thread
Results 1 to 22 of 22

Some type of LOOKUP Function

  1. #1
    Registered User
    Join Date
    04-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Some type of LOOKUP Function

    Ok i am wanting to do something similar to a VLOOKUP that isn't limited.

    These are the 2 sheets i am using:
    excelforum1.JPG

    excelforum2.JPG

    on the first picture Bill of Materials Tab in cell D2 i am wanting it to run a check to see if Cell A2 can be found on image 2 =Sheet1!C2:R33000 If it is found i want it to i want it to pull the <ID> from column A on the same row the ID was found on the second image (Sheet1).

    Hope that makes sense and would that be possible?

    Thanks

    Jack
    Last edited by StormerJack; 12-13-2018 at 08:30 AM.

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: How can we do this?

    Well to start with we can change the title of the post!

    Forum Rules
    Please read and adhere to these simple rules!

    1. Title must briefly summarize your request. (A, Z)

    Attach a sample workbook. 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-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: How can we do this?

    For some reason the file is failing to upload. I am guessing it is because it exceeds the file size limit.
    Last edited by StormerJack; 12-13-2018 at 07:53 AM.

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: How can we do this?

    The forum rule that davsth is referring to is the rule about post titles. Your title MUST reflect your issue, not a question like how can this be done or problem or formula or help needed.
    If a moderator comes along the post will be locked until you change to an appropriate title. Think in terms of someone else with a similar problem to yours, what search terms would they use to find this post?

    And technically nobody is supposed to offer help until you change the post title when that has been requested by a senior forum member.

    As for attachments, you don't need to provide the whole data set, just a representative sample with enough samples to show what you are dealing with AND your expected results.

    Thanks.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Registered User
    Join Date
    04-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: How can we do this?

    Thanks i finally found out how to edit it. The reason i didnt name it in the first place is because i dont know what the function is called that i need to use.
    Last edited by StormerJack; 12-13-2018 at 08:25 AM.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    The file size limit for an .xlsx is about 1Mb. however, it's about 9 for an .xlsb

    if you DO decide to post the whole thing, don't forget to tell us where to look. It's very annoying to be given a file with 10 worksheets and no indication of where the problem is. Normally, I simply close the file and look at anther thread.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Registered User
    Join Date
    04-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Some type of LOOKUP Function

    Thanks again i think i have added the attachment. There is only 2 sheets on the workbook as shown in my screenshots on the first post. Hopefully the first post makes sense what we are looking to do.
    Attached Files Attached Files

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    Untested (60000+ rows does not encourage me to do any manual checking of results...).

    =IFERROR(INDEX(Sheet1!$A$2:$A$65000,SUM(INDEX((Sheet1!$C$2:$R$65000=A2)*ROW(Sheet1!$C$2:$R$65000),))-ROW(Sheet1!$C$2)+1),"")

    copied down.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Some type of LOOKUP Function

    Quote Originally Posted by Glenn Kennedy View Post
    Untested (60000+ rows does not encourage me to do any manual checking of results...).

    =IFERROR(INDEX(Sheet1!$A$2:$A$65000,SUM(INDEX((Sheet1!$C$2:$R$65000=A2)*ROW(Sheet1!$C$2:$R$65000),))-ROW(Sheet1!$C$2)+1),"")

    copied down.
    Thanks Glenn,

    That is what i am looking for although it seems some of them are still blank e.g. Sheet Bill of Materials, Row 2. I ran a search for 316314 on the 2nd tab and found it but unfortunately the formula you put together didnt come back with a result for some reason. It is possibly because it contains multiple ID's within the same cell, is there any way to get around this?

    Thanks again i appreciated it.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    This is closer, but not there yet. You can see there are a few #REF errors. These can be caused if there are duplicates. Certainly the first 3 #REFs are duplicates. Since your "sample" was 60,000 rows i didn't check to see if any of the answers that "worked" were also duplicated. You can check a few!! Since there are duplicates, which column A value do you want to be returned: the first or the last?
    Attached Files Attached Files

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    Update: I'm pretty sure that it's the duplicates that are the problem. So, to repeat: how do you want that handled: first, last, or what??

    One tweak to the formula, as well.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 12-13-2018 at 10:25 AM.

  12. #12
    Registered User
    Join Date
    04-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Some type of LOOKUP Function

    Quote Originally Posted by Glenn Kennedy View Post
    Update: I'm pretty sure that it's the duplicates that are the problem. So, to repeat: how do you want that handled: first, last, or what??

    One tweak to the formula, as well.
    Hi Glenn,

    sorry for the late reply i had to leave early yesterday. I see what you mean about the duplicates, is it some how possible to pull both ID's into the cell separated by a comma or something similar?

    Thanks again for helping with this i really appreciate your time.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    Until you are completely OK with this, I have reduced the massive sheet to a manageable sample. See the sheet. This is easier to test!!

    Please try to identify faults with it. It allows for duplicates. Can there ever be triplicates... or more? If so, how many is the maximum?
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    04-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Some type of LOOKUP Function

    Hi Glenn,

    at first glance it looks fine and also the maximum amount of duplicates i can see on our system is 12.

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    I think we may be talking at cross-purposes. At least, i hope we are!!
    I don't mind how many values occur twice. It can be 1, or 10,0000. Can values occur more than twice? If so what is the maximumn number of times that a value can occur?

    if it's 12, we'll need a diffferent approach altogether.

  16. #16
    Registered User
    Join Date
    04-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Some type of LOOKUP Function

    oh i just found one with more i think this is what you meant when you said duplicates. To make it more clear what we are trying to achieve i will post a brief summary. We are currently using a database system that holds all of our QA documentation but next year in February we are moving to a new system and we need to extract all of the current documentation out of the current system along with a spreadsheet which shows what product each QA Doucment is linked to. Unfortunately our system doesn't have the functionality to allow us to export the Product ID's the document is linked to so i had to export as much information as i could and now i am trying to match them up against the product codes. It is proving rather difficult though as you have noticed some document ID's are linked to multiple products.

    excelforum3.JPG
    Last edited by StormerJack; 12-14-2018 at 08:57 AM.

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    OK. We have reached the end of the road. This will not be possible with a formula. You have three choices.

    1. Put each product code in a separate column. It will be slow to run, but can be done.

    2. Use VBA, in which caese, I'm out... as I am no good with VBA.

    3. Use a UDF that I often use... However, I strongly suspect it'll fall over with such a large dataset.

  18. #18
    Registered User
    Join Date
    04-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Some type of LOOKUP Function

    Thanks Glenn, please leave this thread open for now i will have some meetings with my colleagues over the next week and see what they wish to do.

    Thanks again for your time.

  19. #19
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    Only you can close the thread. If you do go down the VBA route, I suggest that you close this one (if for no other reason that many folk don't look at threads with loads of replies) and re-start in the VBA sub-forum, CLEARLY stating the issue with multiple replicates... right from the start.

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    Me again. Inspiration struck when I was doing something else (idiotic really - it should have occurred to me immediately) Two formulae. One to return the first product code. A second to return all of the rest. By starting the second formula with "If the previous column is blank, do nthing, otherwise run the lengthy calculation" the processing time was about 30 seconds. Try it.

    In D2, copied down:
    =IFERROR(INDEX(Sheet1!$A:$A,AGGREGATE(15,6,ROW(Sheet1!$C$2:$R$65000)/(ISNUMBER(SEARCH($A2,Sheet1!$C$2:$R$65000))),COLUMNS($D:D))),"")

    in E2, copied across 35 columns and then down:
    =IF(D2="","",IFERROR(INDEX(Sheet1!$A:$A,AGGREGATE(15,6,ROW(Sheet1!$C$2:$R$65000)/(ISNUMBER(SEARCH($A2,Sheet1!$C$2:$R$65000))),COLUMNS($D:E))),""))
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    04-14-2016
    Location
    Wakefield
    MS-Off Ver
    Office 365 ProPlus
    Posts
    32

    Re: Some type of LOOKUP Function

    Quote Originally Posted by Glenn Kennedy View Post
    Me again. Inspiration struck when I was doing something else (idiotic really - it should have occurred to me immediately) Two formulae. One to return the first product code. A second to return all of the rest. By starting the second formula with "If the previous column is blank, do nthing, otherwise run the lengthy calculation" the processing time was about 30 seconds. Try it.

    In D2, copied down:
    =IFERROR(INDEX(Sheet1!$A:$A,AGGREGATE(15,6,ROW(Sheet1!$C$2:$R$65000)/(ISNUMBER(SEARCH($A2,Sheet1!$C$2:$R$65000))),COLUMNS($D:D))),"")

    in E2, copied across 35 columns and then down:
    =IF(D2="","",IFERROR(INDEX(Sheet1!$A:$A,AGGREGATE(15,6,ROW(Sheet1!$C$2:$R$65000)/(ISNUMBER(SEARCH($A2,Sheet1!$C$2:$R$65000))),COLUMNS($D:E))),""))
    Amazing! yes this will also work. I will do some spot checks on it tomorrow but i have just had a quick look at a couple and they matched up. Thank you Glenn! us novice excel users would be lost without people like you.

  22. #22
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Some type of LOOKUP Function

    Do let me know if it worked out. If it didn't... shout!!

    And, of course, you're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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