+ Reply to Thread
Results 1 to 11 of 11

Help with lookup formula that returns whole columns

  1. #1
    Registered User
    Join Date
    11-07-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    19

    Help with lookup formula that returns whole columns

    Hi, I apologize for my ignorance on this topic, but this is definitely out of my knowledge base. I'm working on a spreadsheet (Book1 is hopefully attached), and I'm trying to return the data on sheet 2 to sheet 1 based on the lookup value typed into cell D2. It's meant to be an approximate lookup to where if you only give it a little bit of data, then it will return the whole range of data on sheet 2 since the first four numbers would be matching. I really don't even know where to start with this so again, I apologize if I didn't quite word any of it right.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Help with lookup formula that returns whole columns

    A common request, producing a smaller list from a bigger list, usually the request is to remove blank spaces but the process is the same.

    1. in H2 just put the first four characters of what you want to find

    2. in Sheet1!A5
    =IFERROR(INDEX(Sheet2!$A$2:$F$61,AGGREGATE(15,6,ROW(Sheet2!$A$2:$F$61)/((LEFT(Sheet2!$A$2:$A$61,4)="0502")),ROWS(A$2:A2))-(2-1),COLUMN()),"")
    copy across to column F
    and down for as many rows as you have on Sheet2 (in this case to around row 64 / 65
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Help with lookup formula that returns whole columns

    Hi

    Sheet1

    A5=IFERROR(INDEX(Sheet2!A$2:A$61,SMALL(IF(ISNUMBER(SEARCH(Sheet1!$D$2,Sheet2!$A$2:$A$61)),ROW(Sheet2!A$2:A$61)-ROW(Sheet2!A$2)+1),ROWS(Sheet2!A$2:Sheet2!A2))),"")

    Control+Shift+Enter copy across and down

    for hide 0

    custom format [=0]""
    Last edited by CARACALLA; 05-02-2019 at 12:07 PM.

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Help with lookup formula that returns whole columns

    Ignore this post

  5. #5
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Help with lookup formula that returns whole columns

    Ignore this post

  6. #6
    Registered User
    Join Date
    11-07-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    19

    Re: Help with lookup formula that returns whole columns

    Special-K, thank you for the help. Unfortunately, it did not seem to work.

    Hi, CARACALLA. I entered that formula into A5 as shown, then I hit Ctrl+Shift+Enter. It didn't work. Essentially, the value in H2 (with wildcard symbol) needs to return the data from sheet 2. Now, there will be more data ranges like what is currently on sheet 2 which is why H2 needs to be the lookup. when that lookup changes, another data range will pop up(hopefully).

  7. #7
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Help with lookup formula that returns whole columns

    Try this

    A5=IFERROR(INDEX(Sheet2!A$2:A$61,SMALL(IF(ISNUMBER(SEARCH(Sheet1!$D$2,Sheet2!$A$2:$A$61)),ROW(Sheet2!A$2:A$61)-ROW(Sheet2!A$2)+1),ROWS(Sheet2!A$2:Sheet2!A2))),"")


    Control +shift +enter


    copy across and down

  8. #8
    Registered User
    Join Date
    11-07-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    19

    Re: Help with lookup formula that returns whole columns

    Awesome! That works to where it populates the data now. My only issue is, whenever you delete the lookup value in D2, the data doesn't disappear kind of like a VLOOKUP with an IFERROR. No lookup = no data returned. Basically the ability to change the lookup in D2 from 0502 to things like 0503,1511, etc. There will be data on the other sheet that will match that starting criteria, but when you change the lookup in D2, the data returned down below it needs to change as well.

  9. #9
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Help with lookup formula that returns whole columns

    A5=IF($D$2<>"",IFERROR(INDEX(Sheet2!A$2:A$61,SMALL(IF(ISNUMBER(SEARCH(Sheet1!$D$2,Sheet2!$A$2:$A$61)),ROW(Sheet2!A$2:A$61)-ROW(Sheet2!A$2)+1),ROWS(Sheet2!A$2:Sheet2!A2))),""),"")


    Control +shift+enter

  10. #10
    Registered User
    Join Date
    11-07-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    19

    Re: Help with lookup formula that returns whole columns

    Sweet!!!! It works beautifully now! I apologize for not fully giving all of the necessary info you might have needed up front, but I wasn't sure how I needed to word everything.

    Thank you very much!!

  11. #11
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Help with lookup formula that returns whole columns

    You are 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] MATCH across multiple columns returns value from LOOKUP table
    By RoundaboutCJP in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-20-2019, 05:52 AM
  2. Lookup Formula that returns specific variables
    By tbfla in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2017, 09:12 AM
  3. Lookup formula returns #na
    By SNMulrain in forum Excel General
    Replies: 1
    Last Post: 03-15-2017, 10:04 PM
  4. [SOLVED] Lookup Formula that returns value only if it is P
    By Jamidd1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-07-2016, 12:03 PM
  5. Formula that returns the text in another cell NOT a Lookup
    By Cammyd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-31-2013, 08:28 PM
  6. LOOKUP formula returns the value in the row above
    By Conor24 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-22-2012, 11:11 AM
  7. lookup - formula returns wrong value/sum
    By Armitage2k in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-17-2009, 02:43 PM

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