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

Solved Solved
0 4 319
1 ACCEPTED SOLUTION

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:



View solution in original post

4 REPLIES 4

Steve
Platinum 4
Platinum 4

It is, yes.

Can you give me some hints, please

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:



thank you

Top Labels in this Space