Firstly create a dictionary of DictReport(String, String) with the Report.xlsx.
Next read the data of input file and loop through the records, if “No” in record matches with the DictReport(“No”) you can build the logic to read the Period column (and update the sheet with Name, Account Name, Account Number and Amount.)
Use read range for eg(C_APR) and get the data Table of that sheet in memory, append the records in data table.
continue updating all the values in datatable on both the sheets.
after you have finished looping all the records in input sheet, write bothe the data table on respective sheets.
For the Error sheet, create a datatable say ErrorDT and append the values those map to the values “Cut” same as above, except in above case the mapping will be to “NoCut”. Append it to the Error.xlsx file.
Take a look at the logic, you can use it as a guide.
Please take Note: I had to remove empty rows from input and ensure the Results.xlsx file which is used as mapping has same value as input, I noted Lot62(13) was different then Lot062(13)
Hope you have a guide now, you can continue to add the logic to add the records in respective sheets of that period.