Countif with offset

Gerry_F

New Member
Joined
Dec 14, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I have a column with team names and game results in cells offset 2 down always in this order. I am trying to count the times a team is played and capture the total results using offset in a countif but without success.
If there is a working formula, I'll also add another criteria offset down 1 cell for game type
Any help would be appreciated as this is for my sons hockey team

Formulas in D3 is =COUNTIFS($A:$A,$C3,$A:$A,OFFSET($C3,2,0)=D$2)
Also tried an Index in J3 (=COUNTIFS(INDEX($A$7:$A$336,MATCH($H3,$A$7:$A$336,0)+2),J$2))
 

Attachments

  • Games.png
    Games.png
    18.7 KB · Views: 11

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Try:
Book1
ABCDE
1Exhibition
2winloss
3team111
4team201
5team300
6
710/22/24
8team1
9exhibition
10win
11
1210/25/24
13team2
14exhibition
15loss
16
1710/28/24
18team1
19exhibition
20loss
21
Sheet1
Cell Formulas
RangeFormula
D3:E5D3=COUNTIFS($A$8:$A$21,$C3,$A$9:$A$22,$C$1,$A$10:$A$23,D$2)


Side note: I'd recommend restructuring your data like this.
Book1
ABCD
23DateTeamSeasonOutcome
2410/22/24team1exhibitionwin
2510/25/24team2exhibitionloss
2610/28/24team1exhibitionloss
Sheet1
Cell Formulas
RangeFormula
A24:D26A24=WRAPROWS(TOCOL(A7:A20,1),4)
Dynamic array formulas.
 
Upvote 0
For 365 version. Slightly lengthy but spill over formula.
In D3
Excel Formula:
=LET(a,C3:C5,b,D2:F2,c,A8:A18,d,A10:A20,MAKEARRAY(ROWS(a),COLUMNS(b),LAMBDA(ro,cl,SUMPRODUCT((c=INDEX(a,ro))*(d=INDEX(b,cl))))))
1734248802695.png
 
Last edited:
Upvote 0
You can spill with COUNTIFS.
Book1
ABCDE
1Exhibition
2winloss
3team111
4team201
5team300
6
710/22/24
8team1
9exhibition
10win
11
1210/25/24
13team2
14exhibition
15loss
16
1710/28/24
18team1
19exhibition
20loss
Sheet1
Cell Formulas
RangeFormula
D3:E5D3=COUNTIFS(A8:A21,C$3:C$5,A9:A22,C1,A10:A23,D2:E2)
Dynamic array formulas.
 
Upvote 0
Try:
Book1
ABCDE
1Exhibition
2winloss
3team111
4team201
5team300
6
710/22/24
8team1
9exhibition
10win
11
1210/25/24
13team2
14exhibition
15loss
16
1710/28/24
18team1
19exhibition
20loss
21
Sheet1
Cell Formulas
RangeFormula
D3:E5D3=COUNTIFS($A$8:$A$21,$C3,$A$9:$A$22,$C$1,$A$10:$A$23,D$2)


Side note: I'd recommend restructuring your data like this.
Book1
ABCD
23DateTeamSeasonOutcome
2410/22/24team1exhibitionwin
2510/25/24team2exhibitionloss
2610/28/24team1exhibitionloss
Sheet1
Cell Formulas
RangeFormula
A24:D26A24=WRAPROWS(TOCOL(A7:A20,1),4)
Dynamic array formulas.
There's a reason behind it's laid out as I did - players per game are listed in the space along with goalies. But I may need to lay it out slightly different. Thanks
 
Upvote 0
For exibition In D3
Excel Formula:
=LET(a,C3:C5,b,D2:F2,c,A8:A18,d,A10:A20,e,A9:A19,MAKEARRAY(ROWS(a),COLUMNS(b),LAMBDA(ro,cl,SUMPRODUCT((c=INDEX(a,ro))*(d=INDEX(b,cl))*(e="exhibition")))))
For Regular Season in I3
Excel Formula:
=LET(a,H3:H5,b,I2:K2,c,A8:A18,d,A10:A20,e,A9:A19,MAKEARRAY(ROWS(a),COLUMNS(b),LAMBDA(ro,cl,SUMPRODUCT((c=INDEX(a,ro))*(d=INDEX(b,cl))*(e="Regular Season")))))
Change the ranges suitably.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,809
Messages
6,181,076
Members
453,020
Latest member
mattg2448

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