Find a sequence of 4 particular values, by criteria

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
793
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I have two worksheets in the linked file: The first contains the source data. The the second (in the image, below) is the one I need to populate with a function - likely sort of FILTER one. I need to populate columns A and B as per the manually entered entries (highlighted in yellow).

Screenshot 2023-01-16 at 18.43.15.png


What I need to do is, identify the first sequence where 4 particular parkrun events have been completed in 4 consecutive parkruns. With the relevant data then populating the second worksheet, as per the image.

The criteria for identifying the four parkruns is as per below:

IF(OR(LEFT(C4,6)="Pont y",LEFT(C4,5)="Ponte",LEFT(C4,5)="Ponty"),1,"")

Link to the example file (small size and opens quickly) is here: Example.xlsx

Thanks in advance!

Olly.
 

Attachments

  • Screenshot 2023-01-16 at 15.52.39.png
    Screenshot 2023-01-16 at 15.52.39.png
    86.4 KB · Views: 14

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".
On another thread Fluff has now kindly provided a formula in the source data worksheet (in column GW) that identifies where the criteria for this challenge are met and numbers them 1-4. So, what I need in the FILTER formula (or whatever type is required) will be to identify the first instance where there is a run of 1-4 in column GW and then put the relevant Event (Venue) name and Date Completed in the 4 rows of the target worksheet. I have highlighted in the image (below) where this first instance occurs.

Screenshot 2023-01-17 at 13.54.26.jpg


The other thread can be found here: Find (and number) consecutive values of '1'

Thanks.
 
Upvote 0
I think I have now solved this. Not the most sophisticated solution, but it seems to do what I need. I used the following formulas:

In Column A:
=IFERROR(IF(A7<>"",OFFSET(XLOOKUP(4,'All Completed Runs'!$GW$4:$GW$2003,'All Completed Runs'!$C$4:$C$2003),-3,0),""),"")
=IFERROR(IF(A7<>"",OFFSET(XLOOKUP(4,'All Completed Runs'!$GW$4:$GW$2003,'All Completed Runs'!$C$4:$C$2003),-2,0),""),"")
=IFERROR(IF(A7<>"",OFFSET(XLOOKUP(4,'All Completed Runs'!$GW$4:$GW$2003,'All Completed Runs'!$C$4:$C$2003),-1,0),""),"")
=IFERROR(IF('All Completed Runs'!C4<>"",OFFSET(XLOOKUP(4,'All Completed Runs'!$GW$4:$GW$2003,'All Completed Runs'!$C$4:$C$2003),0,0),""),"")

In Column B:
=IFERROR(IF(A7<>"",OFFSET(XLOOKUP(4,'All Completed Runs'!$GW$4:$GW$2003,'All Completed Runs'!$E$4:$E$2003),-3,0),""),"")
=IFERROR(IF(A7<>"",OFFSET(XLOOKUP(4,'All Completed Runs'!$GW$4:$GW$2003,'All Completed Runs'!$E$4:$E$2003),-2,0),""),"")
=IFERROR(IF(A7<>"",OFFSET(XLOOKUP(4,'All Completed Runs'!$GW$4:$GW$2003,'All Completed Runs'!$E$4:$E$2003),-1,0),""),"")
=IFERROR(IF('All Completed Runs'!C4<>"",OFFSET(XLOOKUP(4,'All Completed Runs'!$GW$4:$GW$2003,'All Completed Runs'!$E$4:$E$2003),0,0),""),"")

Screenshot 2023-01-18 at 20.49.34.png


Thanks.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,867
Messages
6,175,077
Members
452,611
Latest member
bls2024

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