Find last occurrence of specific value in a row

前端 未结 2 1277
悲&欢浪女
悲&欢浪女 2021-01-06 01:04

I have a table that keeps scores from fantasy football league. The lowest scoring week is not included in the total.

I\'m able to find the lowest score using the

2条回答
  •  生来不讨喜
    2021-01-06 01:47

    You can also do this using LOOKUP function and avoiding array formulas, e.g. assuming S2 has the minimum value you can get the last week with that value with this formula in T2 copied down

    =LOOKUP(2,1/(B2:R2=S2),B$1:R$1)

    This works because (B2:R2=S2) returns an array of TRUE/FALSE values, and then dividing 1 by that array gives you an array of 1s or #DIV/0! errors. When you use 2 as the lookup value on that array it won't find any 2s so will therefore match with the last number (the last 1) in the array. That corresponds to the last week with your smallest value so using the top row as the "return vector" means that the formula returns the corresponding week number as required

提交回复
热议问题