Excel: Find value across multiple columns and return header column -


i trying find way "unknown" value across multiple columns. when present, return of header columns value appears in 1 cell each row in column b.

for example row 2 (the first row below header row), want return every column name "unknown" appears column f column y row 2 , put column name in b2. want repeat process of 9064 rows.

i using excel 2010. looked match index not able find way wanted do. there way value across multiple columns , return every column header values appears in row , put of column headers 1 cell?

data view

here's custom function. first place following code in regular module (alt+f11 >> insert >> module >> copy/paste >> alt+q)...

function aconcat(a variant, optional sep string = "") string ' harlan grove, mar 2002      dim y variant      if typeof range         each y in a.cells             aconcat = aconcat & y.value & sep         next y     elseif isarray(a)         each y in             aconcat = aconcat & y & sep         next y     else         aconcat = aconcat & & sep     end if      aconcat = left(aconcat, len(aconcat) - len(sep))  end function 

then enter following formula in aa2, confirm control+shift+enter, , copy down:

=substitute(aconcat(if(left(f2:y2,3)="unk",", "&$f$1:$y$1,"")),", ","",1) 

Comments