+ Reply to Thread
Results 1 to 19 of 19

VLOOKUP with multiple records

  1. #1
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    VLOOKUP with multiple records

    Hello friends,

    I want to find out the following. I have 2 sheets namely Master and Vlookup. Master sheet has all the records and Vlookup is the formula sheet.

    I want to know how I can get information extracted to my Vlookup sheet when there are multiple records with same name but with different mobile number.

    Refer highlighted cells.
    Attached Files Attached Files

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: VLOOKUP with multiple records

    =AGGREGATE(15,6,ROW(Master!$A$2:$A$6)/(Master!$A$2:$A$6=$A2),COUNTIF($A$2:$A2,$A2))
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    Quote Originally Posted by tim201110 View Post
    =AGGREGATE(15,6,ROW(Master!$A$2:$A$6)/(Master!$A$2:$A$6=$A2),COUNTIF($A$2:$A2,$A2))
    Thank you for your help but it didn't work. I want this information to appear. If you look at my Master sheet, it has 2 records with Mifzal who is 40 years and has 2 mobile numbers.

    I want to appear all records on Vlookup sheets when I enter "Mifzal".

    Meaning, it should appear,

    Mifzal 40 777123456 and
    Mifzal 40 777654321

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: VLOOKUP with multiple records

    Returning multiple matches (instead of exactly one match) is actually pretty far outside the scope of VLOOKUP. It's doable, but it becomes very dependent on table structures etc. which means it's easy to give you a formula you don't understand that limits what you get out.

    So let's talk about non-VLOOKUP options.

    What is the desired output you want here? Then we can think about achieving that, instead of hacking VLOOKUP particularly.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  5. #5
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    Quote Originally Posted by ben_hensel View Post
    Returning multiple matches (instead of exactly one match) is actually pretty far outside the scope of VLOOKUP. It's doable, but it becomes very dependent on table structures etc. which means it's easy to give you a formula you don't understand that limits what you get out.

    So let's talk about non-VLOOKUP options.

    What is the desired output you want here? Then we can think about achieving that, instead of hacking VLOOKUP particularly.
    Ok Sir. Thank you. This is what I want. I have a subscriber database. I want to extract information when I put subscriber's ID number on cell A2. I want these fields to fill automatically.

    Subscriber's name, Subscriber's mobile number, his age etc.

    Remember, a subscriber can have more than 1 mobile number. So, I want to appear multiple records when we enter subscriber's ID number.

    Example : Subscriber A will have 2 mobile numbers. Subscriber B will have 1 number. I want all 3 records to appear.

  6. #6
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    Anyone out there? I am still waiting for help. Thank you.

  7. #7
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    Do we have to pay for the service?

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: VLOOKUP with multiple records

    There are no ID numbers on the master sheet and cell A2 on the Vlookup sheet has the name Mifzal. It would help us to help you if the file matched up with the description.
    That said, if you are going to keep the name of the subscriber in cells A2:A4 on the Vlookup sheet then put this formula in cell B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    After entering the formula drag the fill handle over to cell C2 then, while B2:C2 are still selected, drag the fill handle down to cell C4.
    This forum is manned by volunteers, so patience is a virtue.
    You do not have to pay for the service on this forum. There is a pay forum (commercial services) on the site if you need faster help.
    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.

  9. #9
    Registered User
    Join Date
    01-31-2019
    Location
    Malaysia
    MS-Off Ver
    office 2013
    Posts
    3
    Here is:
    INDEX(Master!B$2:B$6,AGGREGATE(15,6,ROW(Master!$A$2:$A$6)-ROW($A$1)/(Master!$A$2:$A$6=$A2),COUNTIF($A$2:$A2,$A2)))
    Drag down and to the right
    Last edited by m.jea; 04-09-2019 at 03:52 AM.

  10. #10
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    Quote Originally Posted by m.jea View Post
    Here is:
    INDEX(Master!B$2:B$6,AGGREGATE(15,6,ROW(Master!$A$2:$A$6)-ROW($A$1)/(Master!$A$2:$A$6=$A2),COUNTIF($A$2:$A2,$A2)))
    Drag down and to the right
    Thank you very much and it worked. I appreciate your help

  11. #11
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    Quote Originally Posted by JeteMc View Post
    There are no ID numbers on the master sheet and cell A2 on the Vlookup sheet has the name Mifzal. It would help us to help you if the file matched up with the description.
    That said, if you are going to keep the name of the subscriber in cells A2:A4 on the Vlookup sheet then put this formula in cell B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    After entering the formula drag the fill handle over to cell C2 then, while B2:C2 are still selected, drag the fill handle down to cell C4.
    This forum is manned by volunteers, so patience is a virtue.
    You do not have to pay for the service on this forum. There is a pay forum (commercial services) on the site if you need faster help.
    Let us know if you have any questions.
    Thank you for trying to help me and I appreciate it. I am sorry for asking for assistance in a faster away since I was stuck. Sorry, again.

  12. #12
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    I had to reply to this thread again because the previous solutions didn't work. I am putting an easy database for you to understand. Attached is a new file and it's named as "Policies". This file has 2 sheets, named "Master" and "Formula". Master sheet has all the information. I want to extract information to Formula sheet based on the following condition.

    I have picked 2 policy numbers as examples.

    1) If you look at policy # C11VT2DP04458/18 on the master sheet, it has only 1 record
    2) If you look at policy # AG3VT2DP01190/18 on the master sheet, it has 4 records

    I want to perform this. When I type a policy # on A2 of Formula sheet, B2 and C2 should be automatically filled. Remember, the same policy will have more than 1 record as shown above (refer item # 2).

    When I type AG3VT2DP01190/18, it should fill B3 and C3 and it should keep filling A4, A5 & A6. This scenario can have information like this

    Since AG3VT2DP01190/18 has 4 records, only the first cell (A3) can be filled. Based on that policy number, B3, B4 to be filled. Refer the Formula worksheet.
    Attached Files Attached Files

  13. #13
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: VLOOKUP with multiple records

    See if the following would be an acceptable work around.
    Type the policy #'s that you want to examine into column A. (Actually I would suggest producing a unique list and link to that list with drop downs to avoid possible errors).
    Column B is populated with the number of records for that policy number using: =COUNTIFS(Master!A$2:A$150,A2)
    Column C is populated with beginning row numbers for the 'output table' using: =IF(A1="","",IF(ROW()=2,2,SUM(B1,C1)))
    On the 'output table' (columns F:H)
    The policy # column is populated using: =INDEX(A$2:A$10,MATCH(ROW(),C$2:C$10))
    The receipt # and collected amount columns are populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    Exactly. This is what I want Sir. But a small issue? Can't I get rid of the information from column A, B and C?

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,898

    Re: VLOOKUP with multiple records

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  16. #16
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    Ok Madam. I understand. Sorry about it.

  17. #17
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: VLOOKUP with multiple records

    The information in columns A:C is what produces the 'output table'. You could move the 'output table' to another sheet as modeled in the attached file.
    Let us know if you have any questions.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    04-02-2019
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    49

    Re: VLOOKUP with multiple records

    Thank you Sir. Appreciate your help!

  19. #19
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: VLOOKUP with multiple records

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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. Is there a way to VLookup to find multiple records and return lowest value?
    By Kirk3737 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-26-2018, 07:33 PM
  2. Can Vlookup read multiple records in 1 cell?
    By chloelee in forum Excel General
    Replies: 6
    Last Post: 12-07-2016, 03:40 AM
  3. [SOLVED] VLookup - Single value lookup returning multiple records into multiple columns
    By kllovin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-07-2014, 05:14 AM
  4. Vlookup - How to get it to search and update multiple records
    By androgynyrocks in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2012, 12:29 AM
  5. [SOLVED] Can VLookup function find and list multiple records?
    By Rich - SG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  6. [SOLVED] Can VLookup function find and list multiple records?
    By Rich - SG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. Can VLookup function find and list multiple records?
    By Rich - SG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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