+ Reply to Thread
Results 1 to 10 of 10

a problem extracting data from a database

  1. #1
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    a problem extracting data from a database

    Hi all

    I have recently encountered a problem that i haven't seen before, i hope maybe here i could find the solution...
    here the problem:
    I'm working with a database, and needs to extract certain data out of it (see attached file). i have two columns: letters and numbers.
    up until recently everything was nice and easy: every letter matched with a single number so i could use VLookup to find my data.
    recently the database has changed, and now each letters can match with more than one number (up to 20).
    my question is this: i need a function of some sort, that by writing the 'Input' box with a letter (B for example - see attached file), will automatically fill the 'output' box with the matching data (the numbers 2,3 and 4 in the example).
    my database can be as big as a few Thousand rows...

    is what i'm describing sounds possible?

    i'll be more than grateful for a response (and a solution... )

    thanks in advance

    boaz

    Sample.xlsx

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: a problem extracting data from a database

    Unmerge the Column-A cells and fill it with the above data.

    In E5 Cell - Array Formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

    Drag it down...

    Refer the attached file for reference.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: a problem extracting data from a database

    Amazing!! thanks a LOT!!

    A follow up question: how can i improve this formula to fit more than a one column database? (see attached file)

    thanks again...

    Sample2.xlsx

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: a problem extracting data from a database

    Thanks for the feedback

    In I5 Cell - Array Formula
    =IFERROR(INDEX($B$2:$D$18,SMALL(IF($A$2:$A$18=$I$3,ROW($A$2:$A$18)-ROW($A$2)+1),ROW($A1)),4-COLUMN(C$1)),"")

    Drag it down and right...

    Extended for 3 columns

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I am mentioning the output column number..
    Last edited by :) Sixthsense :); 06-29-2013 at 03:39 AM.

  5. #5
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: a problem extracting data from a database

    once again - amazing!!
    thanks a lot... you just saved me hours of work...

  6. #6
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: a problem extracting data from a database

    hey again
    i thought i could take it from here, but i got stuck again... need a little more help.

    the file attached is the final version of the file i'm using, it is basically the same as before but the locations have changed:
    the database and the input/output page are now in different worksheets,
    and the direction of the output boxes is now from right to left.
    Using your formula, I've succeeded in redirecting the formula to the other worksheet, but i wasn't able to redirect the results
    to their proper location... it insists on staying in the wrong box...

    sorry for nagging...
    and thanks in advance

    Sample4.xlsx

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: a problem extracting data from a database

    In B2 Cell of MAIN sheet - Array Formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Drag it down and right...

  8. #8
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: a problem extracting data from a database

    hey
    thank you again...

    i think maybe i didn't explain myself well: i need the formula to be dragged from the right to the left so that each parameter in the "MAIN" worksheet will be paralel to his equivalent in the "DB" worsheet.
    for example, the "Number" column should be in B2, the Score column should be in column C2 and so on (See Sample4.xlsx in the previous post).
    I apologize for being so petty about it, it just that we're talking about a massive database and it has to work precisely right, other wise it'll take me days to fix it...

    thanks.

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: a problem extracting data from a database

    Just remove

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    from the suggested formula and try...

  10. #10
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: a problem extracting data from a database

    Wow, i feel stupid... thank you so much!!!
    have a great day...

+ 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