2

I have a table TABLE and two cells E1 and E2. The entry of E1 is guaranteed to be a header of TABLE. I'd like to write a formula to check wether the entry of E2 is contained in the table column TABLE["content of E1"].

My current approach looks like this (and does not work):

=COUNTIF(TABLE[E1]; E2)>0

I think excel searches for "E2" in the table headers and does not find anything. How can I approach this problem?

3
  • Don't you want to search the headers, not E1? Commented Sep 24, 2020 at 12:13
  • @SJR Let's say E1 is "Name" and E2 is "Max". I'd like to check whether TABLE[Name] contains "Max". Commented Sep 24, 2020 at 12:28
  • You need to use INDIRECT formula. Commented Sep 24, 2020 at 12:37

1 Answer 1

5

You can use the INDIRECT formula, eg:

=COUNTIF(INDIRECT("TABLE[" & E1 & "]"),E2)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.