How to convert Excel values into buckets?

后端 未结 12 2363
青春惊慌失措
青春惊慌失措 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 16:14

    May be not quite what you were looking for but how about using conditional formatting functionality of Excel

    EDIT: As an alternate you could create a vba function that acts as a formula that will do the calulation for you. something like

    Function getBucket(rng As Range) As String
        Dim strReturn As String
    
        Select Case rng.Value
            Case 0 to 10
                strReturn = "Small"
            Case 11 To 20
                 strReturn = "Medium"
            Case 21 To 30
                 strReturn = "Large"
            Case 31 To 40
                 strReturn = "Huge"
            Case Else
                 strReturn = "OMG!!!"
        End Select
        getBucket = strReturn
    End Function
    

提交回复
热议问题