How to convert Excel values into buckets?

后端 未结 12 2352
青春惊慌失措
青春惊慌失措 2021-02-20 15:48

I have a set of data in Excel and in one column is a estimate (number of weeks)

I want an Excel formula to bucket it into

  • Small
  • Medium
  • La
12条回答
  •  醉酒成梦
    2021-02-20 15:56

    Here is a solution which:

    • Is self contained
    • Does not require VBA
    • Is not limited in the same way as IF regarding bucket maximums
    • Does not require precise values as LOOKUP does

     

    =INDEX({"Small","Medium","Large"},LARGE(IF([INPUT_VALUE]>{0,11,21},{1,2,3}),1))
    

     

    Replace [INPUT_VALUE] with the appropriate cell reference and make sure to press Ctrl+Shift+Enter as this is an array formula.

    Each of the array constants can be expanded to be arbitrarily long; as long as the formula does not exceed Excel's maximum of 8,192 characters. The first constant should contain the return values, the second should contain ordered thresholds,and the third should simply be ascending integers.

提交回复
热议问题