Reputation: 1409
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.
Upvotes: 2
Views: 48
Reputation: 406
Yeah, this is the format to do it.
={"one","two","three","four","five";1,2,3,4,5}
will produce
Upvotes: 1
Reputation: 1107
This seems to work:
=vlookup("Pete", {{"John",9};{"Pete", 2}}, 2, false)
Upvotes: 3