Forum Discussion

Rey721's avatar
Rey721
Copper Contributor
Sep 30, 2024

Help with formula involving multiple columns

Hi 
I dont know if this is been addressed in the past or if someone could help me.

I am trying to sum or count the times one item shows in a list but has values between one amount and the other. For example, there are three columns: one has phone numbers, the other shows the area they belong to, and the third shows how many times that number has been used. I need to calculate, for example, how many calls are between 0 and 10 times for one area, one for calls between 11 and 30, etc. I appreciate the help; below is an example of the table.

 

Toll-Free NumberMarket AreaCompleted Calls  Total between 0 and 10total between 11 and 30
Phone number 1Market Area 11 Market Area 1????????
Phone number 2Market Area 11    
Phone number 3Market Area 12    
Phone number 4Market Area 13    
Phone number 5Market Area 13    
Phone number 6Market Area 14    
Phone number 7Market Area 15    
Phone number 8Market Area 16    
Phone number 9Market Area 17    
Phone number 10Market Area 110    
Phone number 11Market Area 111    
Phone number 12Market Area 115    
Phone number 13Market Area 123    
Phone number 14Market Area 128    
Phone number 15Market Area 129    
  • Rey721 

     

    This formula in column F produces a count of 10 for instances between 0 and 10

     

     

    =COUNTA(FILTER(C2:C16,(C2:C16>0)*(C2:C16<=10)*(B2:B16="Market Area 1")))

     

     

    In column G, this one gave a count of 5, for instances between 11 and 30

     

     

    =COUNTA(FILTER(C2:C16,(C2:C16>=11)*(C2:C16<=30)*(B2:B16="Market Area 1")))

     

     

    If instead of a count, you prefer a SUM, just change the COUNTA to SUM. Since these are numbers being counted, you could also use COUNT rather than COUNTA.

  • mathetes's avatar
    mathetes
    Silver Contributor

    Rey721 

     

    This formula in column F produces a count of 10 for instances between 0 and 10

     

     

    =COUNTA(FILTER(C2:C16,(C2:C16>0)*(C2:C16<=10)*(B2:B16="Market Area 1")))

     

     

    In column G, this one gave a count of 5, for instances between 11 and 30

     

     

    =COUNTA(FILTER(C2:C16,(C2:C16>=11)*(C2:C16<=30)*(B2:B16="Market Area 1")))

     

     

    If instead of a count, you prefer a SUM, just change the COUNTA to SUM. Since these are numbers being counted, you could also use COUNT rather than COUNTA.

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    Hi Rey721 

     

    With (almost) any version of Excel, assuming data in Table1:

     

    in G4:

    =COUNTIFS(
      Table1[Market Area], F4,
      Table1[Completed Calls], ">=" & 0,
      Table1[Completed Calls], "<=" & 10
    )

    in H4:

    =SUMIFS(
      Table1[Completed Calls],
      Table1[Market Area], F4,
      Table1[Completed Calls], ">=" & 0,
      Table1[Completed Calls], "<=" & 10
    )

     

    For >=11 & <= 30 same as above, just change the numbers (Implemented in attached file)

Resources