Formula Help Needed.

DarrenF

Board Regular
Joined
Jun 9, 2014
Messages
90
If I want to count how many days someone worked based off the name in column B and the Day of the Month in Column C what kind of formula would I need?

[TABLE="width: 546"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD][TABLE="width: 546"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD] A[/TD]
[TD] B [/TD]
[TD] C[/TD]
[/TR]
[TR]
[TD]Ticket Number[/TD]
[TD]Name[/TD]
[TD]Day of the Month[/TD]
[/TR]
[TR]
[TD]11501679[/TD]
[TD]Jimmy Johns[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]11514116[/TD]
[TD]Jimmy Johns[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]11514524[/TD]
[TD]Jimmy Johns[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]11514782[/TD]
[TD]Jimmy Johns[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]11515051[/TD]
[TD]Jimmy Johns[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]11515282[/TD]
[TD]Jimmy Johns[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]11515549[/TD]
[TD]Jimmy Johns[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]11516527[/TD]
[TD]Jimmy Johns[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]11517261[/TD]
[TD]Jimmy Johns[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]11520796[/TD]
[TD]Jimmy Johns[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]11520849[/TD]
[TD]Jimmy Johns[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]11524429[/TD]
[TD]Jimmy Johns[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]11525140[/TD]
[TD]Jimmy Johns[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]11525675[/TD]
[TD]Jimmy Johns[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]11525787[/TD]
[TD]Jimmy Johns[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]11527125[/TD]
[TD]Jimmy Johns[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]11527223[/TD]
[TD]Jimmy Johns[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]11389189[/TD]
[TD]Magic Johnson[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]11392994[/TD]
[TD]Magic Johnson[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]11393375[/TD]
[TD]Magic Johnson[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]11393776[/TD]
[TD]Magic Johnson[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]11394171[/TD]
[TD]Magic Johnson[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]11396216[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11397851[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11398554[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11398898[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11399327[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11399546[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11400425[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11406878[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11406966[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11407147[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11408630[/TD]
[TD]Magic Johnson[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]11409083[/TD]
[TD]Magic Johnson[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]11409302[/TD]
[TD]Magic Johnson[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

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 PowerQuery

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#70AD47]Name[/td][td=bgcolor:#70AD47]Day of the Month[/td][td=bgcolor:#70AD47]Days[/td][td][/td][td=bgcolor:#70AD47]Name[/td][td=bgcolor:#70AD47]Days[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]Jimmy Johns[/td][td=bgcolor:#E2EFDA]
2​
[/td][td=bgcolor:#E2EFDA]
4​
[/td][td][/td][td=bgcolor:#E2EFDA]Jimmy Johns[/td][td=bgcolor:#E2EFDA]
17​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]Jimmy Johns[/td][td]
3​
[/td][td]
1​
[/td][td][/td][td]Magic Johnson[/td][td]
18​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]Jimmy Johns[/td][td=bgcolor:#E2EFDA]
4​
[/td][td=bgcolor:#E2EFDA]
3​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Jimmy Johns[/td][td]
5​
[/td][td]
3​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]Jimmy Johns[/td][td=bgcolor:#E2EFDA]
6​
[/td][td=bgcolor:#E2EFDA]
3​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Jimmy Johns[/td][td]
9​
[/td][td]
3​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]Magic Johnson[/td][td=bgcolor:#E2EFDA]
10​
[/td][td=bgcolor:#E2EFDA]
5​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Magic Johnson[/td][td]
11​
[/td][td]
11​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]Magic Johnson[/td][td=bgcolor:#E2EFDA]
12​
[/td][td=bgcolor:#E2EFDA]
2​
[/td][td][/td][td][/td][td][/td][/tr]
[/table]


for bigger table
Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Name", "Day of the Month"}, {{"Days", each Table.RowCount(_), type number}})
in
    #"Grouped Rows"[/SIZE]

or

for smaller table
Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Name"}, {{"Days", each Table.RowCount(_), type number}})
in
    #"Grouped Rows"[/SIZE]
 
Last edited:
Upvote 0
=SUMPRODUCT( --(B2:B36="Jimmy Johns"), 1/COUNTIF(C2:C36, C2:C36))
 
Upvote 0
one more possibility

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#70AD47]Name[/td][td=bgcolor:#70AD47]Count[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]Jimmy Johns[/td][td=bgcolor:#E2EFDA]
6​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]Magic Johnson[/td][td]
3​
[/td][/tr]
[/table]

Code:
[SIZE=1]
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Day of the Month", "Name"}, {{"Count", each Table.RowCount(_), type number}}),
    #"Grouped Rows1" = Table.Group(#"Grouped Rows", {"Name"}, {{"Count", each Table.RowCount(_), type number}})
in
    #"Grouped Rows1"[/SIZE]
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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