Forum Discussion

SDL39FAN's avatar
SDL39FAN
Copper Contributor
Oct 03, 2021
Solved

Finding count of item between number ranges between two tables

Hi.    I have two tables, one has unique rows and the other has multiple rows.   The unique Rows table  has a SCAC column, four columns of details (AAR Mech, Length interior, Length exterior, and...
  • byundt's avatar
    Oct 03, 2021

    @t would have been helpful if you had a sample file with perhaps a dozen rows and the desired results from the formula.

     

    Based on my understanding of the question, you are probably wanting a COUNTIFS formula that matches the SCAC and counts the number of rows where the car # is within the from and to range.

     

    In my test workbook, I named the worksheets UniqueRows and EquipmentList. UniqueRows column A is SCAC, column F is the From and column G is the To. EquipmentList column A is SCAC and column B is the car #.

     

    I put the following formula in UniqueRows cell I2 and copied it down.

     

    =COUNTIFS(EquipmentList!A:A,A2,EquipmentList!B:B,">=" & F2,EquipmentList!B:B,"<=" & G2)

     

Resources