Here are the 2 formulae that I came up with to replicate your spreadsheet
For YS
Sum(
:Name( "m(AB)" ) == -1,
:Name( "m(BC)" ) == -1,
:Name( "m(CD)" ) == -1,
:Name( "m(EF)" ) == -1,
:Name( "m(FG)" ) == -1,
:Name( "m(GH)" ) == -1,
:Name( "m(HI)" ) == -1,
:Name( "m(IJ)" ) == -1,
:Name( "m(JK)" ) == -1,
:Name( "m(KL)" ) == -1,
:Name( "m(LM)" ) == -1,
:Name( "m(MN)" ) == -1
)
For PD
Contains(
Char( :Name( "m(AB)" ) ) || Char( :Name( "m(BC)" ) ) ||
Char( :Name( "m(CD)" ) ) || Char( :Name( "m(EF)" ) ) ||
Char( :Name( "m(FG)" ) ) || Char( :Name( "m(GH)" ) ) ||
Char( :Name( "m(HI)" ) ) || Char( :Name( "m(IJ)" ) ) ||
Char( :Name( "m(JK)" ) ) || Char( :Name( "m(KL)" ) ) ||
Char( :Name( "m(LM)" ) ) || Char( :Name( "m(MN)" ) ),
"-1"
)
Jim