Data to Excel

Suppose I have three columns Name, AGE, Account Number, One name can have multiple account numbers. So how do I make a corresponding entry against Name with multiple account numbers in different rows?

When you write your row , you need to add Name,age for multiple account numbers too ( Like looping Account numbers )
Can make all account numbers in single column itself as below
Example :- String.join (",",Listaccountnumbers)