+ Reply to Thread
Results 1 to 19 of 19

Sum the number of rows within a range in a table, containing any data

  1. #1
    Registered User
    Join Date
    10-30-2018
    Location
    Bradford, England
    MS-Off Ver
    365
    Posts
    17

    Sum the number of rows within a range in a table, containing any data

    I need a formula to put in one cell, that will display how many rows within a range within a table have any data in them at all. One row with multiple cells containing data should just count as one row. Blank rows should not count towards the total.

    Any help greatly appreciated.

    Edit: In addition to the initial request, Fluff13 provided a formula further down the thread that enables the table column names to be entered in two cells outside the table so that the formula uses these two cells to define the columns in the table. Pretty neat!
    Last edited by JPollard; 11-10-2022 at 11:27 AM. Reason: Thread included additional solved requests.

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

    Re: Sum the number of rows within a range in a table, containing any data

    Sounds as if you want to COUNT the rows, rather than SUM them - perhaps you can use COUNTIF/S, but it is difficult to say exactly without seeing an example file - follow the guidelines in the yellow banner at the top of the screen.

    Pete

  3. #3
    Registered User
    Join Date
    10-30-2018
    Location
    Bradford, England
    MS-Off Ver
    365
    Posts
    17

    Re: Sum the number of rows within a range in a table, containing any data

    Hi Pete,
    Thanks for the reply. Example file attached.

    Jonathan
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,433

    Re: Sum the number of rows within a range in a table, containing any data

    One way is to put this in a column in the Table and switch on Totals.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    10-30-2018
    Location
    Bradford, England
    MS-Off Ver
    365
    Posts
    17

    Re: Sum the number of rows within a range in a table, containing any data

    Thanks TMS. That's a great way to do it but I wonder if there is also a way with a formula in one cell outside the table?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,433

    Re: Sum the number of rows within a range in a table, containing any data

    Are you still using Excel 2013?

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Sum the number of rows within a range in a table, containing any data

    If you are updated to Excel 365 you can try this formula outside the table:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by HansDouwe; 11-10-2022 at 09:23 AM.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Sum the number of rows within a range in a table, containing any data

    If you now have 365 or 2021
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or non-volatile for earlier versions
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or volatile version
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Sum the number of rows within a range in a table, containing any data

    The formula in post #7 does not look to a specific period.

    If you want to look to a specific period, please adjust the range in the formula, for example:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by HansDouwe; 11-10-2022 at 09:40 AM.

  10. #10
    Registered User
    Join Date
    10-30-2018
    Location
    Bradford, England
    MS-Off Ver
    365
    Posts
    17

    Re: Sum the number of rows within a range in a table, containing any data

    Thanks for the question, TMS. I've updated my profile to show I'm using 365.
    Last edited by JPollard; 11-10-2022 at 11:05 AM.

  11. #11
    Registered User
    Join Date
    10-30-2018
    Location
    Bradford, England
    MS-Off Ver
    365
    Posts
    17

    Re: Sum the number of rows within a range in a table, containing any data

    Thanks for this detailed reply, Fluff13. I use 365 and the first formula works great.
    Last edited by JPollard; 11-10-2022 at 11:05 AM.

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Sum the number of rows within a range in a table, containing any data

    Glad to help & thanks for the feedback.

  13. #13
    Registered User
    Join Date
    10-30-2018
    Location
    Bradford, England
    MS-Off Ver
    365
    Posts
    17

    Re: Sum the number of rows within a range in a table, containing any data

    Thanks HansDouwe. This formula works great. I found that Fluff13's formula does actually also work for a specific period when I tested it.
    Last edited by JPollard; 11-10-2022 at 11:06 AM.

  14. #14
    Registered User
    Join Date
    10-30-2018
    Location
    Bradford, England
    MS-Off Ver
    365
    Posts
    17

    Re: Sum the number of rows within a range in a table, containing any data

    So the formulas from Fluff13 and HansDouwe both work great. Thanks so much to both for their speedy replies and different approaches but equally effective formulas.

    A further question: I want to be able to enter the period start in one cell and the period end in another cell (both outside the table and matching the names of table columns) so that the formula uses these two cells to define the columns in the table.

    Any ideas?

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Sum the number of rows within a range in a table, containing any data

    If you are entering the start & end points as text
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    10-30-2018
    Location
    Bradford, England
    MS-Off Ver
    365
    Posts
    17

    Re: Sum the number of rows within a range in a table, containing any data

    Thanks again Fluff13. That works a beaut!

  17. #17
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Sum the number of rows within a range in a table, containing any data

    I found that Fluff13's formula does actually also work for a specific period when I tested it.
    My formula in post #9 does also

  18. #18
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Sum the number of rows within a range in a table, containing any data

    You're welcome & thanks for the feedback.

  19. #19
    Registered User
    Join Date
    10-30-2018
    Location
    Bradford, England
    MS-Off Ver
    365
    Posts
    17

    Re: Sum the number of rows within a range in a table, containing any data

    Quote Originally Posted by HansDouwe View Post
    My formula in post #9 does also
    It does indeed. I made reference to it working in a direct reply to that post and in a further reply in the whole thread. Thanks 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. Replies: 1
    Last Post: 02-20-2020, 08:18 AM
  2. Replies: 2
    Last Post: 07-22-2019, 01:47 AM
  3. [SOLVED] Insert Xnumber (X=A1) of rows between data in a table& copy data from a range to new cells
    By blue_clouds_mountain in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-09-2019, 12:47 PM
  4. Replies: 1
    Last Post: 11-25-2014, 08:35 PM
  5. Replies: 2
    Last Post: 08-27-2014, 03:13 PM
  6. Popiulate Table from Data Range With Varying number of Records
    By CDEG in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2013, 10:43 PM
  7. [SOLVED] Pivot Table - max rows allowed in data range
    By dmotika in forum Excel General
    Replies: 2
    Last Post: 05-26-2005, 05:15 PM

Tags for this Thread

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