worksheet function - Excel: Concatenate/retrieve cells that are across a merged key cell -


assume simple sheet so:

 ------------- |  1  |   |  need formula return: "a,b,c" |     |-----| |     |  b  | |     |-----| |     |  c  | ------------- |  2  |   |  need formula return: "a,b" |     |-----| |     |  b  | ------------- 

the first column merged key cells , second column has unknown number of rows text values in each cell.

what want means, such vlookup/hlookup, retrieve list of cells across merged key cell.
if want use macros, how retrieve a-b-c cell range programmatically result of vlookup on "1"?

if doesn't work, i'm fine logical check on whether letter exists in list.
example, given key value, want able programmatically apply conditionals like:

 - "does 'a' exist @ '1'? yes." - "does 'c' exist @ '2'? no." 

edit:
keep in mind above example; not know there 'a', 'b', , 'c'; not know number of rows in each set.

thanks.

this give true/false, though can nest in if statement yes/no.

=not(iserror(vlookup("b",indirect(address(match(1,a:a,0),2)&":"&address(match(2,a:a,0)-1,2)),1,0))) 

the variables "b" letter for, 1 in first match statement number key off of, , 2 in second match statement 1 variable +1.

the formula first determines range of cells in column 2 1 variable, determining starts, , going 1 less next number ends. of course work if numbers consecutive , ordered. vlookup on range determined, example $a$1:$a$3.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -