Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9023801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:50:57+00:00 2026-06-16T05:50:57+00:00

I have a table with student IDs separated in groups. I need a handy

  • 0

I have a table with student IDs separated in groups. I need a handy way to count the total number of students in each group and populate it after the last row of each group (marked with ??)

enter image description here

Currently I just enter =COUNT() and then manually figure out the top and bottom borders of the range for each group. Not convenient at all.

I was thinking that a possible solution could be one of the following:

  1. A some kind of pivot table permutation. I failed on this one.
  2. Excel Data->Outline->Subtotals functions. Again, fail. It keeps creating new rows in my table.
  3. A universal formula that can be pasted into each ?? cell. Not the most graceful solution, but still would do.
  4. A macro. As a last remedy if nothing else works.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:50:59+00:00Added an answer on June 16, 2026 at 5:50 am

    The following steps will calculate the subtotals while preserving the structuring and formatting of your worksheet.

    1. Put this formula in cell C1 and copy the formula down the column:

      =IF(NOT(ISERROR(SEARCH("Total",A1))),COUNTA(INDIRECT("B"&MATCH(LEFT(A1,LEN(A1)-7),A:A,0)+1&".B"&(MATCH(A1,A:A,0)+1))),IF(B1="","",B1))
      
    2. Apply a conditional format to cell C1 with the formula rule =(MOD(ROW(C1),2)=0) and blue fill to match the shading on the other rows. Copy the format down the column using Paste Special Format.

    3. Either hide column B, or copy the values in column C to column B using Paste Special Values and hide Column C. If you decide to copy the values to column B, you won’t need to set the conditional formats.

    Here is what the formula does:

    • First, check whether the formula’s row is a Total row, by searching the cell in column A of the row for the word “Total,” using the SEARCH function.

      If the word “Total” is found:

      Determine the range in the worksheet of the student IDs for the group for that total row:

      a) Identify the rows in which the words “GroupX” and “GroupX Total” are found by using the MATCH function. With that, you know that the IDs for the group are in a range that starts at, say, row x and ends at row y.

      b) With the starting and ending row numbers, construct the address range in which the IDs lie, which has to be the string “B” + (row x) + “.” + “B” + (row y).

      c) Turn the string into a range reference that can actually used in a formula using the INDIRECT function.

      Count the number of students in the group using the COUNTA function and the range, and show that as the formula’s result.

      If the word “Total” is not found

      Check whether the cell in column B is empty

      a) If it is empty, show a blank as the formula’s result

      b) if it is not empty, it must be a student ID, so show the ID as the formula’s result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table of student scores. Students can take the test multiple times,
I have a table that includes some student group name, lesson time, day names
I have a table with sequential numbers (think invoice numbers or student IDs). At
I have two tables. Student and Job. I need to search students who possess
I have a table that looks like this for about ~30 students: StudentID Course*
I have a table student ( id, name ). Then I have one textbox,
I have a database table named 'student' in which there is one column named
I have two tables associated by FK. Table student is mapped like this: @Entity
I have three tables. The designs were like student table create table student (studID
i have a table which consists of student details like roll no, Name, age.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.