Using XLOOKUP (or some other function) to collect and transpose data based on recurrence

Walkon

New Member
Joined
Dec 13, 2021
Messages
29
Office Version
  1. 365
Platform
  1. Windows
Good day,
I have a data set that lists employees and their associated departments (Table 1 below). I want to create a new sheet that transposes the data so that the rows are the departments and the columns are the employees (Table 2 below). In the actual data set, there are many more columns in Table 1 and Name and DeptID are not adjacent. IS this possible with XLOOKUP or some other function (pivot table?).

1686871485856.png
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Assuming you have it setup as a Table via Insert -> Table, you can use the named references, Filter, and Transpose to get it to work:
Excel Formula:
=TRANSPOSE(FILTER(Table1[Full Name], (Table1[DeptID]=$D3)))

$D3 here would be the first Department, SKE in your table, to the left of Christia Hooper.
 
Upvote 1
Solution
Dragging that formula down gives me this:
 

Attachments

  • Screenshot 2023-06-15 at 7.37.12 PM.jpg
    Screenshot 2023-06-15 at 7.37.12 PM.jpg
    227.2 KB · Views: 8
Upvote 0
Assuming you have it setup as a Table via Insert -> Table, you can use the named references, Filter, and Transpose to get it to work:
Excel Formula:
=TRANSPOSE(FILTER(Table1[Full Name], (Table1[DeptID]=$D3)))

$D3 here would be the first Department, SKE in your table, to the left of Christia Hooper.
Good afternoon,

Thank-you very much for the quick reply and the solution! This has saved me loads of time and frustration.

All the best,

Walkon
 
Upvote 0
Good afternoon,

Thank-you very much for the quick reply and the solution! This has saved me loads of time and frustration.

All the best,

Walkon
You're welcome!

Would you mind marking my post above as the answer so that this thread shows up as solved? It also gives me credit for an answer, which is nice. ;)
 
Upvote 0
Happy to. I think I just did that but am new so let me know if it doesn't appear.
Thx
 
Upvote 0

Forum statistics

Threads
1,215,143
Messages
6,123,276
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top