+ Reply to Thread
Results 1 to 13 of 13

Rollup and count

Hybrid View

  1. #1
    Registered User
    Join Date
    05-12-2025
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    6

    Rollup and count

    How to count the list of employees rolling upto a manager.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,725

    Re: Rollup and count

    =IFERROR(VLOOKUP(B2,$A$2:$B$10,2,0),"")
    Do you mean this??
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Registered User
    Join Date
    05-12-2025
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    6

    Re: Rollup and count

    Thank you Popipipo for your response,

    In the table I was looking for answer which will translate to ...

    Chris would have a roll up totaling to 8 reportees.
    DEF would have a roll up totaling to 5 reportees.
    MNO would have a roll up totaling to 2 reportees.

    Finally Mike would have total roll up of employees 9 reportees.

    does that make good example ?

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,725

    Re: Rollup and count

    Is this better?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-12-2025
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    6

    Re: Rollup and count

    Popipipo,

    The count is good, but only thing which I have Column A and B only. I do not have other column's, for representation sake I have kept that. And my real data is more than 20,000 rows.

    Greatly appreciate your inputs.

    Thanks,

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2506
    Posts
    13,792

    Re: Rollup and count

    Edited:

    Since your profile is Excel 2016 you do not have the SORT function.

    In I2 you may have to array enter this formula. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    =INDEX($B$2:$B$10,MATCH(0,COUNTIF($B$2:$B$10,"<"&$B$2:$B$10)-SUM(COUNTIF($B$2:$B$10,I$1:I1)),0))
    Then in J2 to get the counts.
    Formula: copy to clipboard
    =COUNTA(INDEX($B$2:$B$10,MATCH(I2,$B$2:$B$10,0)):INDEX($B$2:$B$10,MATCH("zzzz",$B$2:$B$10)))
    Attached Files Attached Files
    Last edited by FlameRetired; 05-12-2025 at 05:40 PM.
    Dave

  7. #7
    Registered User
    Join Date
    05-12-2025
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    6

    Re: Rollup and count

    Thank you at flame retired. This is what I was looking for.

    When I tried to replicate the same using the formulas in the actual file with more than 23,000 rows, it is not working. The other system is having Microsoft Office 365 Version 2505.

    Could you please explain me, how the formula works.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2506
    Posts
    13,792

    Re: Rollup and count

    Quote Originally Posted by chitti_us View Post
    ....
    When I tried to replicate the same using the formulas in the actual file with more than 23,000 rows, it is not working. The other system is having Microsoft Office 365 Version 2505.
    In your next post please copy and paste the exact formula you are using that doesn't work.

  9. #9
    Registered User
    Join Date
    05-12-2025
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    6

    Re: Rollup and count

    In I2 you may have to array enter this formula. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    =INDEX($B$2:$B$10,MATCH(0,COUNTIF($B$2:$B$10,"<"&$B$2:$B$10)-SUM(COUNTIF($B$2:$B$10,I$1:I1)),0))

    When I am copying the command from I2, to I3, I4, I5 etc., it is giving me the message " # N / A ".

  10. #10
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2505 and WPS V2024(12.1.0.18543)
    Posts
    4,113

    Re: Rollup and count

    Office 365 pls try
    Formula: copy to clipboard
    =LET(m,B2:B10,n,UNIQUE(m),HSTACK(n,DROP(REDUCE("",n,LAMBDA(x,y,VSTACK(x,LET(pos,MATCH(y,m,0),COUNTA(m)-pos+1)))),1)))
    Last edited by wk9128; 05-13-2025 at 10:45 PM.

  11. #11
    Registered User
    Join Date
    05-12-2025
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    6

    Re: Rollup and count

    Thank you very much wk9128, this formula did worked.

    Take a bow to your knowledge.

    Could you please explain how this works.

  12. #12
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2505 and WPS V2024(12.1.0.18543)
    Posts
    4,113

    Re: Rollup and count

    @chitti_us You're Welcome. Glad to help . Thank You for the feedback and rep.

    Hi chitti_us POST#03 said "Finally Mike would have total roll up of employees 9 reportees."

    Although formula and code was achieved
    Why isn't it 1? You need to explain clearly, why should I explain ?

    VBA USER DEFINE CODE for Office 2016

    Formula: copy to clipboard
    =wk(B2:B10)


    Function wk(rng As Range) As Variant
        Dim m As Variant
        Dim dict As Object
        Dim result() As Variant
        Dim i As Long, j As Long
        Dim count As Long, pos As Long
        Dim key As Variant
        Dim keysArray() As Variant
        m = rng.Value
        Set dict = CreateObject("Scripting.Dictionary")
        For i = 1 To UBound(m, 1)
            If Not dict.exists(m(i, 1)) And Not IsEmpty(m(i, 1)) Then
                dict.Add m(i, 1), 1
            End If
        Next i
        ReDim result(1 To dict.count, 1 To 2)
        keysArray = dict.keys
        For i = 0 To dict.count - 1
            result(i + 1, 1) = keysArray(i)
            pos = Application.Match(keysArray(i), m, 0)
            count = Application.CountA(rng) - pos + 1
            result(i + 1, 2) = count
        Next i
        wk = result
    End Function
    Last edited by wk9128; 05-13-2025 at 11:14 PM.

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2506
    Posts
    13,792

    Re: Rollup and count

    @chitti_us

    The reason I asked you to post the formula you are using when mine worked is that quite often formula range references are not correct.

+ 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. Sum - Rollup -
    By yarlachiru in forum Excel General
    Replies: 7
    Last Post: 05-06-2021, 06:59 AM
  2. Performance Rollup
    By Jarredt in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-04-2019, 12:45 PM
  3. [SOLVED] Multi-Tab Rollup
    By Irukandji81 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-25-2017, 01:40 PM
  4. Monthly Rollup of data
    By cure4glass1 in forum Excel General
    Replies: 7
    Last Post: 05-30-2011, 01:56 PM
  5. Complex matrix count and rollup
    By pcdj in forum Excel General
    Replies: 5
    Last Post: 01-12-2010, 04:28 PM
  6. Rollup in excel?
    By RoachForLife in forum Excel General
    Replies: 3
    Last Post: 05-03-2007, 03:29 PM
  7. Large rollup from other workbooks
    By rlcohen in forum Excel General
    Replies: 2
    Last Post: 04-27-2005, 10:48 PM

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