2

Is it possible to have an array within a formula, as opposed to referencing the array in cells.

For example with VLOOKUP, I have tried to do this but it doesn't work:

=VLOOKUP(I2,[["Superking",4],["King",3],["Double",2],["Single",1]],2,0)

I'm essentially trying to incorporate the below table into the formula itself:

Superking      4
-----------------------------
King           3
-----------------------------
Double         2
-----------------------------
Single         1

I thought that this is maybe possisble but expressing the array incorrectly.

I do know that this can easily be done by putting the actual data into the sheet, but I am interested to know if it is posisble to do it this way.

2 Answers 2

3

This seems to work:

=vlookup("Pete", {{"John",9};{"Pete", 2}}, 2, false)
Sign up to request clarification or add additional context in comments.

Comments

1

Yeah, this is the format to do it.

={"one","two","three","four","five";1,2,3,4,5}

will produce

img of an array splayed

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.