Your second worksheet is protected so can't test...but
In order to create a single formula that you can copy down and be able to extract from both sheet, it would be advisable to have the same setup in both sheets...
Then...
You would apply the same helper formula in R2 of Timetabled Service sheet...
=IF(O2="Y",MAX(R$1:$R1)+1,0)
copied down.
then in the "fixed" Frequent Service sheet R1, add formula:
=Max('Timetabled Service'!R:R)
and in R2, copied down:
=IF(O2="Y",MAX(R$1:$R1)+1,0)
In G1 of DDA sheet..
=Max('Frequent Service'!R:R)
and in A3:
=IF(ROWS($A$1:$A1)>$G$1,"",IF(ISNUMBER(MATCH(ROWS($A$1:$A1),'Timetabled Service'!$R:$R,0)),INDEX('Timetabled Service'!D:D,MATCH(ROWS($A$1:$A1),'Timetabled Service'!$R:$R,0)),INDEX('Frequent Service'!D:D,MATCH(ROWS($A$1:$A1),'Frequent Service'!$R:$R,0))))
Bookmarks