0

The two-way table is a table where the value of a dependent variable is dependent on two independent variables, so actually it's a mix of two one-way tables.

XLOOKUP a two-way table

When you lookup for a value in a two-way table, XLOOKUP might look like this:

=XLOOKUP(H5, months,XLOOKUP(H4,names, data))

My question is why can't we specifically choose the range instead of an inner lookup? Why do we write another XLOOKUP function inside an XLOOKUP when we can specifically choose a range, which we do always, don't we?

P.S. I know I am wrong in my last sentence; moreover, I know I am missing something, but what's it? Please help me with this. I am exhausted.

1 Answer 1

3

The inner xlookup returns a single row of the data, corresponding to the name in H4:

enter image description here

The outer one then choses the desired column from this row (resulting in a single cell), corresponding to the month in H5. In this case, "Mar" is the third column, so 10525 is the output.

You can also write this formula with index and match, which I believe is a little more understandable:

=INDEX(data,MATCH(H4,names,0),MATCH(H5,months,0))

You must log in to answer this question.