Google Sheets – Lookup Value to Retrieve Entire Column

google sheetsgoogle-sheets-query

Here is my problem:

I have a table starting in A1 with D

D C B A
1 2 3 4
5 6 7 8

I want a function that returns me the column of data of whatever letter give it.

ie input:=function("C")

output:

2
6

input: =function("A")

output:

4
8

I can't just query because the column is changing.

Hlookup? but how do you get the whole column as a return?

Best Answer

If I'm understanding correctly:

=FILTER(A2:D3,A1:D1=A5)