Compare values in a list

Hello, I'm trying to compare multiple values in a list, this list contains the results of other formulas and it goes something like this:

ListTOTAL: BAJO, BAJO, BAJO, ALTO, ALTO, INMINENTE

What I want to do is have a formula that says, if in the ListTOTAL there's 'INMINENTE' the result will be: Riesgo Inminente. Because it has 1 INMINENTE in the list

The trick is that the list sometimes can be just: ListTOTAL: BAJO, BAJO, BAJO, ALTO

So if that's the case I want the result of the formula to be: 'Riesgo Alto' because it has 1 ALTO in the list

And sometimes the list can also be for example: ListTOTAL: BAJO, BAJO, BAJO so the result of the formula has to be 'Riesgo Bajo' because all the values of the list are BAJO

I've tried multiple formulas like this one:

if(in("Inminente",[ListTOTAL])=true(),"Riesgo Inminente", "") but that only works when in the list there's an INMINENTE value

Please let me know what can I do to have the formula to compare the values when INMINENTE or ALTO are not in the list and there's only BAJO for example. Or when only ALTO and BAJO are in the list.

Thank you.

0 4 172
4 REPLIES 4

I think you may want to mention if several other combinations are possible or not.

For example, can the list be BAJO, BAJO, BAJO, ALTO, ALTO, INMINENTE ,  INMINENTE

or  ALTO, ALTO, INMINENTE ,  INMINENTE

or  BAJO, ALTO, ALTO

or ALTO, INMINENTE

In short there can be various other combinations.  If you could mention the possible combinations of list in more detail and what results you would expect for those combinations, perhaps the community could suggest an option that works for your all required combinations.

In generally you are looking for..
IFS(
IN("Inminente",[ListTOTAL]),"Riesgo Inminente",
IN("Alto",[ListTOTAL]),"Riesgo Alto",
IN("Bajo",[ListTOTAL]),"Riesgo Bajo"
)
But if you need more combinations, you need to wrap IN() with the AND()

so the main combination it's that if on the list there's an INMINENTE the only possible result should be 'Riesgo Inminente'

The second possible combination is that if there isn't any INMINENTE and only ALTO and BAJO, then the result should be ALTO

and the third combination is when there isn't any INMINENTE or ALTO in the list and only BAJO, then the result should be BAJO

 

#1 - "if on the list there's an INMINENTE the only possible result should be 'Riesgo Inminente'" > The first row in the IFS() takes care of this situation

#2 - " if there isn't any INMINENTE and only ALTO and BAJO, then the result should be ALTO" > If there is no "Inminente", it skips the 1st row and if there is at least one "Alto", it finds it.

#3 - "there isn't any INMINENTE or ALTO in the list and only BAJO, then the result should be BAJO" > If there is no Anminente or Alto, it skips rows 1 and 2, and then it finds the "Bajo".

Top Labels in this Space