Forum Discussion
talotaibi
Jul 21, 2023Copper Contributor
Searching for a formula to select the highest value
I need help creating a formula in Excel, as I have four values in the left column (Minor, Moderate, Major, Extreme) and on the right column, it should show in the cell of the highest value from the l...
- Jul 21, 2023
=IF(COUNTIF(I2:I5,"extreme"),"extreme",IF(COUNTIF(I2:I5,"major"),"major",IF(COUNTIF(I2:I5,"moderate"),"moderate",IF(COUNTIF(I2:I5,"minor"),"minor",""))))
Does this return the intended result?
talotaibi
Jul 22, 2023Copper Contributor
Detlef_Lewin sadly, shows an error
PeterBartholomew1
Jul 22, 2023Silver Contributor
I suspect the reason is that you do not have access to Excel 365. Taken to the extreme 365 solutions bear little similarity to traditional spreadsheet solutions. For example
= LET(
scale, {"Minor";"Moderate";"Major";"Extreme"},
TAKE(FILTER(scale, COUNTIFS(rate, scale)),-1)
)
sets up the scale and counts the number of occurrences for each level. Then filtering out levels that do not occur and returning the final value gives the desired result.