+ Reply to Thread
Results 1 to 3 of 3

Display an array of values from a column range

  1. #1
    Registered User
    Join Date
    09-25-2009
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    51

    Display an array of values from a column range

    Hi,

    I a have a matrix like table as show in the image below:
    ibju30XaMmrXNh.jpg

    I need a formula in cell B18, C18, D18 etc.. that will list all cell values from colum A if in column B (or C, D etc.. depending of the formula) there is a certain value.

    For example in range B2:B17 we have the value "2" in three cells. The formula should display "B2,B4,B14" as values from range A2:A17 that have in range B2:B17 the value 2.

    The formula should be something like this (I know it's not even close the be correct):
    =IF("2" is in range B2:B17; "B2,B4,B14"; "-")
    This formula must be used for the rest of the columns C, D, E...
    =IF("2" is in C2:C17; "B1,B8"; "-") etc...

    So if a value.. let's say 2 is in range B2:B17, display "B2,B4,B14" (here B2,B4,B14 are random cell values not column names.

    I have no ideea what functions to use, and I don't even know if it's possible... (I cant use MATCH for the "value is in range" thing because if there is no such value in range it will return #N/A error. I cant use vlookup for the display of values because vlookup doesn't work when the search item is not the first argument in the range...)

    I'm sorry if my post is not very clear, and I would be happy to answer any questions that will you help me

    Thank you for your help!
    Last edited by alexandruc; 02-14-2012 at 04:07 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Display an array of values from a column range

    See if this UDF does what you are looking for:
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-25-2009
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    51

    Re: Display an array of values from a column range

    Quote Originally Posted by WHER View Post
    See if this UDF does what you are looking for:
    Thank you very much WHER!

    It does exactly what I wanted! I'll try to understand the function, and if I have questions I hope you won't mind if I post them

    I somehow thought that it can't be done without macros...

    Again, thank you very much!

+ 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