Column B has values like (new,Change,Term,Empty or null ).
Processing rows : New, Change,
Comparing with : Term, Empty
If Processing row data New Matches with Term or empty rows data. Then Get the plan ID for Term or null from column C and Update the Column C for New row.
Similarly Processing Row Change Matches with Term or empty rows.Then Get the plan ID for Term or null from column C and Update the Column C for Change row.
Note: While processing if it matches with first row then it shouldn’t process the next row
Example : If New row matches with Term row then it should not process to check the Next Term row or Empty row. Similarly for change row as well