Count of total requests assigned

Jonam711

New Member
Joined
Jun 11, 2022
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Sorry guys for the blurred image. I need count the total assignings for employees based on the first table. There are two different categories (requests and tickets) and the total of both has to be derived in the total assigned column in second table. Thanks guys!
 

Attachments

  • IMG_20240703_200446.jpg
    IMG_20240703_200446.jpg
    195 KB · Views: 18

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try:
VBA Code:
Sub CountRequests()
    Application.ScreenUpdating = False
    Dim v As Variant, i As Long, dic As Object, k As Variant, rng As String
    v = Range("A2", Range("A" & Rows.Count).End(xlUp)).Value
    Set dic = CreateObject("Scripting.Dictionary")
    For i = LBound(v) To UBound(v)
        If Not dic.exists(Range("A" & i + 1).MergeArea.Address(0, 0)) Then
            dic.add Range("A" & i + 1).MergeArea.Address(0, 0), Nothing
            Cells(Rows.Count, "F").End(xlUp).Offset(1) = v(i, 1)
            rng = Range("A" & i + 1).MergeArea.Offset(, 1).Resize(6, 2).Address(0, 0)
            Cells(Rows.Count, "G").End(xlUp).Offset(1) = WorksheetFunction.CountA(Range(rng))
        End If
    Next i
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Try:
VBA Code:
Sub CountRequests()
    Application.ScreenUpdating = False
    Dim v As Variant, i As Long, dic As Object, k As Variant, rng As String
    v = Range("A2", Range("A" & Rows.Count).End(xlUp)).Value
    Set dic = CreateObject("Scripting.Dictionary")
    For i = LBound(v) To UBound(v)
        If Not dic.exists(Range("A" & i + 1).MergeArea.Address(0, 0)) Then
            dic.add Range("A" & i + 1).MergeArea.Address(0, 0), Nothing
            Cells(Rows.Count, "F").End(xlUp).Offset(1) = v(i, 1)
            rng = Range("A" & i + 1).MergeArea.Offset(, 1).Resize(6, 2).Address(0, 0)
            Cells(Rows.Count, "G").End(xlUp).Offset(1) = WorksheetFunction.CountA(Range(rng))
        End If
    Next i
    Application.ScreenUpdating = True
End Sub
Thank you very much. It can't be derived with formulas? As my office people prefer it.
 
Upvote 0
The merged cells make the formula more complicated but try:
Book2
ABCDEF
1
2Jack1Jack6
31Nick3
41Rick1
51
61
71
8Nick1
91
101
11
12
13
14Rick
151
16
17
18
19
Sheet3
Cell Formulas
RangeFormula
F2:F4F2=MAP(E2:E4,LAMBDA(m,SUM(--(FILTER(B2:C19,SCAN("",A2:A19,LAMBDA(a,b,IF(b="",a,b)))=m)<>""))))
Dynamic array formulas.
 
Upvote 0
The merged cells make the formula more complicated but try:
Book2
ABCDEF
1
2Jack1Jack6
31Nick3
41Rick1
51
61
71
8Nick1
91
101
11
12
13
14Rick
151
16
17
18
19
Sheet3
Cell Formulas
RangeFormula
F2:F4F2=MAP(E2:E4,LAMBDA(m,SUM(--(FILTER(B2:C19,SCAN("",A2:A19,LAMBDA(a,b,IF(b="",a,b)))=m)<>""))))
Dynamic array formulas.
Thanks but we won't be mentioning the numbers. We update the request number and need the count of it. In the formula provided I see there is SUM
 
Upvote 0
Thanks but we won't be mentioning the numbers. We update the request number and need the count of it. In the formula provided I see there is SUM
It's summing booleans. Did you try it?
 
Upvote 0
Clear out the cells below. It's a spill formula.
 
Upvote 0
Clear out the cells below. It's a spill formula.
It worked, awesome. Let's say the cells are not merged and the emp name stays in the first cell of their request assigned how the formula looks plesse
 
Upvote 0
It worked, awesome. Let's say the cells are not merged and the emp name stays in the first cell of their request assigned how the formula looks plesse
It'd be simpler if each row had a name, but it'd be similar to the merged cells.
Book2
ABCDEFG
1Drag downSpill formula
2JackAJack66
3BNick33
4CRick11
5D
6E
7F
8NickG
9H
10I
11
12
13
14Rick
15J
16
17
18
19
Sheet3
Cell Formulas
RangeFormula
G2:G4G2=MAP(E2:E4,LAMBDA(m,SUM(--(FILTER(B2:C19,SCAN("",A2:A19,LAMBDA(a,b,IF(b="",a,b)))=m)<>""))))
F2:F4F2=SUM(--(FILTER($B$2:$C$19,SCAN("",$A$2:$A$19,LAMBDA(a,b,IF(b="",a,b)))=E2)<>""))
Dynamic array formulas.


Book2
ABCDEFG
1Drag downSpill formula
2JackAJack66
3JackBNick33
4JackCRick11
5JackD
6JackE
7JackF
8NickG
9NickH
10NickI
11Nick
12Nick
13Nick
14Rick
15RickJ
16Rick
17Rick
18Rick
19Rick
Sheet3
Cell Formulas
RangeFormula
G2:G4G2=MAP(E2:E4,LAMBDA(m,SUM(--(FILTER(B2:C19,A2:A19=m)<>""))))
F2:F4F2=SUM(--(FILTER($B$2:$C$19,$A$2:$A$19=E2)<>""))
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,221,787
Messages
6,161,960
Members
451,734
Latest member
Anmol Pandey19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top