How to Compare the data rows and update the Column Plan ID column if it matches the exact row data?

Column B has values like (new,Change,Term,Empty or null ).

Column B
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

If New or change row doesn’t matches with Term or Empty row data. Then update New or change that particular row with TBD.
Example.xlsx (9.9 KB)
Main.xaml (28.7 KB)