# Using created filter to filter specific value base on other cells value

I can't seem to figure this out. I am wonder if it is possible to create a filter for a column, and then filter that column based on another cells value. So I have created a filter for A column which contains values of TEST1,TEST2. I then have a dropdown in C1 that have the values of First, Second.

Here is the formula I put on costume formula. It does not return any value. Also, I am not new to coding, so I don't know if this is right.

=IF(C1="First",A2:A="TEST1",IF(C1="Second",A2:A="TEST2"",""))

• It isn't clear what you're asking. Please include a sample of your data as well as another example of your expected results. I've provided an answer below based on a "best guess" Nov 6 at 1:19
• docs.google.com/spreadsheets/d/… The formula you provided will work for filtering in a new array. What I am wondering is if it is possible to use the created filter and a costume formula in it to sort a specific value if a value in another cell is true (First, Second). Thanks for the answer. Nov 6 at 22:07

# Formula

``````=IFNA(
FILTER(
A2:A, A2:A=
HLOOKUP(
C1,{"First", "Second";
"TEST1", "TEST2"}, 2, 0)))
``````

The same formula as a single line:

``````=IFNA(FILTER(A2:A,A2:A=HLOOKUP(C1,{"First","Second";"TEST1","TEST2"},2,0)))
``````

# Explanation

1. FILTER `A2:A` for values that match the result of a HLOOKUP.
2. The HLOOKUP returns the value in the second row of the same column whose first row matches `C1`.
3. IFNA returns a blank value instead of an error if `C1` doesn't match a value in the HLOOKUP or if the FILTER result is empty.