return column header for each value occurrence in a table

Rosa94

New Member
Joined
Jul 2, 2019
Messages
9
Hello,

I have a table countries and jobs in that country. I am looking to select the job and get all the countries that job is in. Example: select Janitor and the output will show USA,China and Canada

USASpainChinaCanadaMexico
JanitorPayrollJanitorHRManager
OperatorPayrollJanitor
Manager2DVP
HR

<tbody>
</tbody>

Is this something excel can do or is this something only access can process?
Thank you for your help.
Rosa
 
Have I told you how amazing your are? :biggrin:

I know, but I have not won the Nobel Prize yet
rotfl2.gif
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Where do i put the lovely pivot table code you provided me?

How do i get the Header and Name options on my table? When i try to create my pivot table I get the list of countries for my options.
 
Upvote 0
i cant get my power query to work :(. I'm still getting the list of countries to choose from not "header" and "name"
 
Upvote 0
ab ovo...

  1. copy M-code from the post
  2. select your source range
  3. from the ribbon -Data - From Table (it will open new window)
  4. in Advanced Editor replace code with copied code (make sure the name of the table is the same like in replaced code)
  5. it should show transformed table in PQ Editor
  6. Close&Load as .... Connection only

then
Insert - Pivot Table ... the rest is on the movie
 
Upvote 0
:LOL::LOL::LOL:
You are welcome

Now you can click Like/Thanks at the bottom left corner in post(s) which helped you :)

Have a nice day
 
Upvote 0

Forum statistics

Threads
1,215,032
Messages
6,122,770
Members
449,095
Latest member
m_smith_solihull

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