Forum Discussion

Deleted's avatar
Deleted
Oct 10, 2018

Count cells from Company to Company.

Company  402 has 5 lines before Company 421. Want to enter the line count either in formula or Macro. Any help would be appreciated.

  Count
1Company Number:   4025
 ABC MANUFACTURING CO., INC.5
 1 JONES RD SE5
 ATLANTA GA 303155
 Yes5
1Company Number:   4216
 JAMES, LLC6
 1 SWITZ6
 ST LOUIS MO 631476
 555/555-55556
                      No active products6
1Company Number:   4648
 THE Company8
 1821 LARKIN8
 MIDLAND MI 8
 555/555-55558
 Yes8
 No active8
  8
1Company Number:   4025
 DEF MANUFACTURING CO., INC.5
 1 JONES RD SE5
 ATLANTA GA 303155
 Yes5
1Company Number:   402 
    • Deleted's avatar
      Deleted

      Can I get the count cells to all be the total number of cells counted? instead of 1-5 it puts 5 in all of them, or 6 depending on how many rows are counted?

      • Detlef_Lewin's avatar
        Detlef_Lewin
        Silver Contributor

        Matt,

         

        formula for helper column D:

        =IF(A2,SUM(D1,1),D1)

        Formula for column B:

        =COUNTIFS($D$2:$D$41,D2) 

         

Resources