How to loop through each row in excel and increase count if row has marks < 40

Hi @Ramakrishna.E ,

It does look like there are similar type of queries raised before, you could Check some of the few posts already present which matches your input Data, some are provided below :