I modified your formulas and added another band column. This populated the columns correctly..
New Column( "band1",
numeric,
Formula(
If(
8 <= :input <= 11, 11,
14.5 <= :input <= 17.5, 17.5,
.
)
)
);
New Column( "band2",
numeric,
Formula(
If(
8 <= :input <= 10 & :mode == "Tx", 10,
.
)
)
);
New Column( "band3",
numeric,
Formula(
If(
10 <= :input <= 11 & :mode == "Tx", 11,
.
)
)
);
New Column( "AvgS11M",
Numeric,
Formula(
If( :band1 == :input,
Col Mean(
:test_1,
:Name( "RowCol-Chnl-PartNo" ),
:mode,
:teststate,
:band1
),
.
)
)
);
New Column( "AvgS22M",
Numeric,
Formula(
If( :band1 == :input,
Col Mean(
:test_3,
:Name( "RowCol-Chnl-PartNo" ),
:mode,
:teststate,
:band1
),
.
)
)
);
New Column( "AvgS21M",
Numeric,
Formula(
If(
mode == "Rx" & :band1 == :input, Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band1 ),
mode == "Tx" & :band2 == :input, Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band2 ),
mode == "Tx" & :band3 == :input, Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band3 ),
.
)
)
);
New Column( "S11M_AVG",
Numeric,
Formula(
If( Is Missing( :Band1 ) == 0,
Col Mean(
:test_1,
:Name( "RowCol-Chnl-PartNo" ),
:mode,
:teststate,
:band1
),
.
)
)
);
New Column( "S22M_AVG",
Numeric,
Formula(
If( Is Missing( :Band1 ) == 0,
Col Mean(
:test_3,
:Name( "RowCol-Chnl-PartNo" ),
:mode,
:teststate,
:band1
),
.
)
)
);
New Column( "S21M_AVG",
Numeric,
Formula(
If(
mode == "Rx" & Is Missing( :Band1 ) == 0, Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band1 ),
mode == "Tx" & Is Missing( :Band2 ) == 0, Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band2 ),
mode == "Tx" & Is Missing( :Band3 ) == 0, Col Mean( :test_2, :Name( "RowCol-Chnl-PartNo" ), :mode, :teststate, :band3 ),
.
)
)
);