Count Rows until two values are matched

sjfolly23

New Member
Joined
Aug 3, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, I have tried several ways to achieve the result I want but can't quite get there|

I have two columns, Column A = Y, Column B = Team.

A B
Team 1
Team 3
Y Team 2
Y Team 1

I Want to count the number of rows until I get a Y in column A and Team 1 In Colum B, eg 4

Hope someone can help.
Regards
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Welcome to Mr Excel forum

Try something like this
Pasta2
ABCDE
1Header1Header2TeamResult
2Team 1Team 14
3Team 1Team 23
4YTeam 2Team 36
5YTeam 1
6Team 3
7YTeam 3
Plan9
Cell Formulas
RangeFormula
E2:E4E2=AGGREGATE(15,6,(ROW(A$2:A$100)-ROW(A$2)+1)/((A$2:A$100="Y")*(B$2:B$100=D2)),1)


Hope this helps

M.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,918
Messages
6,122,241
Members
449,075
Latest member
staticfluids

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