Attach a sample workbook
Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.
The only way you can do this in excel is by adding the data set to data model and merging it in power query and use this merged data set to build power pivot. There are a lot of resources available on internet how to do this, please give a google search. Alternatively, if you do not have power query in excel , you can use access to merge the data and link it to excel to create pivot