I have a data like as below.
ABC 1 300 500 "He is a good student and has scored lot of marks in 2nd term during
He also focuses on extracurricular activities"
DEF 2 400 600 "He is a good student and has scored lot of marks in 2nd term during
He also focuses on extracurricular activities"
I would like to two keywords/sentence to each student based on a criteria like below
ABC - "2nd term during Aug, 2022", "Needs Improvement on Maths"
DEF - "2nd term during Aug, 2022","Needs Improvement on Science"
So, I tried the below
wb = xw.Book('foo.xlsx')
ws = wb["input"]
for i in range(A1:A1048756):
s = ws.cell(i).value
if s == 'ABC':
ws.cell(i).value = s.replace(
"He is a good student and has scored lot of marks in 2nd term during",
"He is a good student and has scored lot of marks in 2nd term during Aug,2022. Needs improvement on Maths")
However, am not sure whether this is the best way to do this. Moreover, I don't know how can I set formatting for certain part of the text in a cell.
I expect my output to be like as below

