It is not possible to change the template or the output Excel sheet by record values.
It is possible by using the flow.
- Create a template and OFC_Template record for the number of patterns.
- Get records by flow, branch conditionally by field values, and set the template.
Instruction manual