+ Reply to Thread
Results 1 to 4 of 4

Count number of rows with data

  1. #1
    Registered User
    Join Date
    08-11-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2016 & 365
    Posts
    39

    Count number of rows with data

    Hello,

    I'm trying to figure out how to count the number of rows that contain data.

    I have 4 columns and numerous rows. Each column represents a class. Each row represents a participant. I want to know how many unique participants we've had in the classes. I'm assuming SumProduct would work, but I can't figure out how to formulate it.

    In the table below, we have 4 potential participants, but only 3 of them have come to class. 3 is the number I'm looking for.

    Names Date Date Date Date
    Participant 1 1/20/2018 2/14/2018
    Participant 2 2/14/2018
    Participant 3
    Participant 4 1/20/2018

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Count number of rows with data

    Assuming that your dates are in B2:C5, try this:

    =SUMPRODUCT(--(SUBTOTAL(9,OFFSET(B2:C2,ROW(B2:C5)-ROW(B2),,1))>0))

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Count number of rows with data

    If your first Date column is B, then you could try this:

    =COUNT(B:B)

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    08-11-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2016 & 365
    Posts
    39

    Re: Count number of rows with data

    I like to be complicated. Both actually work and are helpful. The more complex formula is what I was looking for. However, due to the formula I was using to pull the dates, the 1st column would be the first to have any value so it wasn't necessary. I'm adding it to my list though just in case I ever need it again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. count columns with data then insert that number of rows
    By johnson1421 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-12-2014, 06:54 PM
  2. Search for specific data and count number of rows till empty Cell
    By kjanani30 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2013, 06:05 AM
  3. Replies: 4
    Last Post: 05-30-2013, 06:00 PM
  4. [SOLVED] Inserting number of rows based on a count of data
    By Ranelagh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 10:30 AM
  5. [SOLVED] Basic - Count number of rows with data
    By OcMac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2012, 06:37 AM
  6. Count number of rows with data in a column....
    By MAButler in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2011, 02:31 PM
  7. Macro to count rows of different data and put that number in a cell
    By king12yan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2010, 04:31 PM
  8. How can i count number of rows between two data?
    By disto in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-02-2008, 11:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1