Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
You could use the "stack" function for your first problem and for the second you could write a custom function to create a matrix to your specifications.
BTW, its always better to additionally attach the worksheet itself additionally and not just post pictures.