Sum columns base on the text = value

I have columns in my data asking Red, Yellow or Green

Once the user has fill out the app I want to score these columns and show a total.

I what result the value of Red = 1, Yellow = 2 & Green =3 (just for scoring but still have the true value of Red, Yellow or Green pushed into the database)

Is this possible

Roger.Wareham:

Is this possible

It is, yes.

Can you give me some hints, please

1 Like
SUM(
  LIST(
    SWITCH([column1], "Red", 1, "Yellow", 2, "Green", 3, 0),
    SWITCH([column2], "Red", 1, "Yellow", 2, "Green", 3, 0),
    ...
    SWITCH([columnN], "Red", 1, "Yellow", 2, "Green", 3, 0),
  )
)

See also:

3 Likes

thank you

1 Like