Home > Blockchain >  Assign a value for a text cell
Assign a value for a text cell

Time:11-04

is it possible to assign a value for a cell that contains text?

To illustrate a lit bit let´s suppose that Barcelona has 8 Titles, Real Madrid 8, Bayern Munchen 5, Arsenal 7

So every time I see a cell that contains "Barcelona" it is equal to 8 and "Arsenal" equals to 7. Meaning that if sum the cell containing "Barcelona" and "Arsenal", the output will be 15. Is it possible to make something like this without having to use another table with those established values?

Thank you!!!

CodePudding user response:

The following will work, but you have to type it out every time:

=SWITCH(A1,"Barcelona",8,"Arsenal",7,"Real Madrid",8,"Bayern Munchen","5")

It sounds like what you want is a defined name. Just go to the formulas ribbon and click define name. Then Type in the name of the Team and Enter the constant under the refers to box. enter image description here

Now you'll be able to use Arsenal in your formulas and it will result in 7.

enter image description here

  • Related