Case Function Equivalent in Excel

前端 未结 12 905
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 18:29

I have an interesting challenge - I need to run a check on the following data in Excel:

|   A  -   B  -   C  -  D   |
|------|------|------|------|
|  36  |          


        
12条回答
  •  爱一瞬间的悲伤
    2020-12-30 19:06

    Try this;

    =IF(B1>=0, B1, OFFSET($X$1, MATCH(B1, $X:$X, Z) - 1, Y)
    

    WHERE
    X = The columns you are indexing into
    Y = The number of columns to the left (-Y) or right (Y) of the indexed column to get the value you are looking for
    Z = 0 if exact-match (if you want to handle errors)

提交回复
热议问题