I am trying to come up with a formula to go in column G of the example DATA sheet that will concatenate the 0 or 1 values in columns A & B & C of the DATA sheet and use that concatenated result to match on the 1^{st} column in the LOOKUP sheet and return the value in the 2^{nd} column of the LOOKUP sheet which is a list of one or more columns in the DATA sheet to return values from. If there is more than one column returned from the LOOKUP sheet, I want to separate the values from those columns with commas, as per my example.

I have the Concatenate bit working and the VLOOKUP from the Lookup table working in the case where there is just a single column to output but not sure how to do this if there is more than one column to output without the formula getting real ugly.

This is what I have so far for the formula in cell G1 of the DATA sheet which returns the value in column D of the DATA sheet:

=INDIRECT(VLOOKUP(CONCATENATE(A1,B1,C1),LOOKUP!$A$1:$B$7,2,FALSE)&ROW())

[TABLE="class: grid, width: 500"]

[tr]

[TD="colspan: 7"]**DATA sheet**[/TD]

**A**

**B**

**C**

**D**

**E**

**F**

**G**

0

[/td][td]0

[/td][td]1

[/td][td]Bat

[/td][td]Dog

[/td][td]Cat

[/td][td]Formula should output: Bat

[/td][/tr][tr][td]1

[/td][td]1

[/td][td]0

[/td][td]Frog

[/td][td]Mouse

[/td][td]Lemur

[/td][td]Formula should output: Frog, Lemur

[/td][/tr][tr][td]0

[/td][td]1

[/td][td]1

[/td][td]Horse

[/td][td]Fly

[/td][td]Lion

[/td][td]Formula should output: Horse, Fly, Lion

[/td][/tr][tr][td]1

[/td][td]1

[/td][td]1

[/td][td]Bat

[/td][td]Rat

[/td][td]Turkey

[/td][td]Formula should output: Bat, Rat, Turkey

[/td][/tr]

[/TABLE]

[TABLE="class: grid, width: 500"]

[tr]

[TD="colspan: 2"] **LOOKUP sheet**[/TD]

Value to match on

[/td]

[TD="width: 113"] Cols to ouput to col G in data sheet[/TD]

[TD="width: 102"] **A**[/TD]

[TD="width: 113"] **B**[/TD]

[TD="width: 102"] 001[/TD]

[TD="width: 113"] D[/TD]

[TD="width: 102"] 010[/TD]

[TD="width: 113"] E[/TD]

[TD="width: 102"] 100[/TD]

[TD="width: 113"] F[/TD]

[TD="width: 102"] 110[/TD]

[TD="width: 113"] D, F[/TD]

[TD="width: 102"] 101[/TD]

[TD="width: 113"] D, E[/TD]

[TD="width: 102"] 011[/TD]

[TD="width: 113"] D, E, F[/TD]

[TD="width: 102"] 111[/TD]

[TD="width: 113"] D, E, F[/TD]

[/TABLE]

Thanks in advance

Deutz