Can I do a "Lookup" for a Defined Name and use it in a single cell?

34 Views Asked by At

I'm working on a sort of "simulator/calculator" for a game. (I'll just use sword as an example going forward)

The game uses different formulas to calculate the ATK of different swords, so I have these various formulas stored as Defined Names.

What I'm hoping to do is, within one cell, retrieve the correct formula for a given sword and use it to calculate the ATK.

I was hoping I could setup a table with the different swords and the Defined Names of the formulas then use a lookup function/method to retrieve and use them.

Something like: XLOOKUP(A1, B1:B10, C1:C10) where column B is the list of swords and C is the list of Defined Names. However I can't seem to make this work.

The only success I've had is by using long IFS functions to pair a given sword with it's associated ATK formula.

IFS(A1="Rusty Sword",swdAtk1, A1="Bronze Sword",swdAtk2, A1="Steel Sword",swdAtk3)

Any ideas would be greatly appreciated!

0

There are 0 best solutions below