+ Reply to Thread
Results 1 to 12 of 12

VLOOKUP or INDEX formula to return multiple values in the same column

  1. #1
    Registered User
    Join Date
    10-05-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Post VLOOKUP or INDEX formula to return multiple values in the same column

    Hi everyone!

    I would like insert a formula that will create a list of all the invoices of a specific supplier. I know that a VLOOKUP formula only shows the first match it finds, but I would like it to list all the invoices.

    Please see the attachment if you are interested in helping me.

    Any help on this matter would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-18-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    I'd like to know if there's a formulaic answer to this aswell - if I were to do this I'd write a macro to loop through the invoices and compile another list where values match.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,813

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    Do you want all invoice numbers, or just those from a particular month? If for one month, how would this be indicated in the Vendor Lookup sheet?

    Pete

    EDIT: Jon - it can be done with formulae, as I hope to demonstrate later.

  4. #4
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    Please see the attached file

    You will need column helper to get row number of Invoices
    1 column by 108 rows with Array Formula
    =SMALL(IF(('Sep 2012'!G2:G109='Vendor Lookup'!B2)*('Sep 2012'!R2:R109<>"Paid"),ROW(1:108)),ROW(1:108))

    then you must using Index to get the right data
    =INDEX('Sep 2012'!$B$2:$B$109;'Vendor Lookup'!A26)

  5. #5
    Registered User
    Join Date
    10-05-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    Thank you for your attempt, dwint. However, the formula does not seem to work as soon as you change the supplier name. It only picks up the existing supplier.

    Pete,

    For simplicity sake, I'd like a formula for, let's say, only Octobers invoices. As soon as we have that under lockdown, we can expand the formula to include other months as well.
    The end results in my mind should list all the invoices of the specific supplier with the following information relating to each invoice:

    [*]Invoice number[*]Invoice date[*]Expected payment date[*]Gross amount[*]Currency[*]Status

    Thank you for the help.

    Raidon

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    Hi

    One way could be this one.

    In A26 and copy down, this Array formula.

    Please Login or Register  to view this content.
    See if this works for you.

    If yes, we can do for all months..
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  7. #7
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    do not use Merged Cells as they are inimical to formulaic operations. use Centred Across Selection instead.

    another way, rendered less efficient due to use of INDIRECT, would be (see highlighted regions in Yellow):
    Attached Files Attached Files
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,813

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    Okay, yet another one. I've used INDIRECT, but have avoided the array formulae by having a helper column (U) in each monthly sheet, and a new column A in the Vendor sheet.

    I've also shown all 3 month's data, with up to 20 rows per month. You can use the filter drop-down in cell A25 (set to not equal to hypen) to bunch these up.

    Hope this helps.

    Pete
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-05-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    Hi all,

    Thanks Pete, icestationzbra and Fotis1991 for the help and providing three excellent different solutions. You all are clearly Excel experts. I only wish I could have thought of it myself .

    Have a nice day

    Raidon

  10. #10
    Registered User
    Join Date
    10-05-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Post Re: VLOOKUP or INDEX formula to return multiple values in the same column

    Hi all,

    Thanks Pete, icestationzbra and Fotis1991 for the help and providing three excellent different solutions. You all are clearly Excel experts. I only wish I could have thought of it myself .

    Have a nice day

    Raidon

  11. #11
    Registered User
    Join Date
    10-05-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    Quote Originally Posted by Fotis1991 View Post
    Hi

    One way could be this one.

    In A26 and copy down, this Array formula.

    Please Login or Register  to view this content.
    See if this works for you.

    If yes, we can do for all months..
    Hi Fotis,

    Clearly your formula works perfectly, but I've tried to analyse it and I dont quite understand how it works and why it works.

    Do mind giving a breakdown of the formula, so that I can understand what each part of the formula is doing and why?

    Many thanks

    Raidon

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: VLOOKUP or INDEX formula to return multiple values in the same column

    =INDEX('Sep 2012'!$B$2:$B$1000,SMALL(IF('Sep 2012'!$G$2:$G$1000='Vendor Lookup'!$B$2,ROW('Sep 2012'!$B$2:$B$1000)-1),ROW('Sep 2012'!B1)))

    SMALL(IF('Sep 2012'!$G$2:$G$1000='Vendor Lookup'!$B$2,ROW('Sep 2012'!$B$2:$B$1000),ROW('Sep 2012'!B1

    Looking for the first match of Vendor Lookup B2, in that range. As you copy down is looking for the second, third, e.tc.(Row(B2), Row(B3)....ETC.

    -1, IS because your data in Sept2012, starts in the second row. If they start in third row, then will be -2. ETC.......

+ 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