Employee Information

humility36

New Member
Joined
Dec 16, 2019
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
Good Afternoon Excel Team,

I've been given a task to clean up an excel spreadsheet and create a better way to view the data. I've tried to use VLOOKUP and HLOOKUP but it does not seem to be working right. Let me explain a little more

I have a spreadsheet that has employee information and areas that they are trained in. I need to be able to pull up their name and then display all the areas that they are trained in.


IDFirst NameLast NameShiftDepartmentShippingBuildingReceivingPutAwaysForklift
1ABCDEFGHIJ
223645GeorgeLucasNightsQAPOXX
355698SallyMaeDaysShippingXXX
499687JohnDoeNightsBuildingXXNC
589778SteveSmithDaysReceivingXNTX
6LEGEND
X = trainedNT = needs trainedPO = position offeredNC = Needs Certified

ABOVE is the format and layout of my table. My lookup value is their unique ID number and I can do a VLOOKUP on the ID to pull their first name, last name, shift, and department. The problem is that I need to pull the column name of the areas that they are trained in. I've been fighting with Index / Match, SEARCH, VLOOKUP, and HLOOKUP functions but I cannot get it right. Here's the logic:

1. Insert ID
2. Populate first name, last name, shift, department, and then list out areas they are trained in

FUTURE STATE:

I enter the ID number in A3 and the rest of the information populates. I'm having trouble figuring out how to search for non-empty cell and then displaying the column and then also displaying the contents of the Cell

ABCDE
1This is where I need help in this column. If the cell is not empty, the display the column nameIf the cell is NOT empty, display the contents of the cell.
2IDFIRSTLASTShiftDepartmentAreas TrainedIcon
389778SteveSmithDaysReceivingReceivingX
4ForkliftX
5PutawaysNT
6
7


If there is any way you guys can help me with this, I would be super grateful. With over 300 names, it's very hard manage and hunt and find it all.
Thanks everyone for your help!

- Humility36
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
something like this?
unp.jpg

or
pqptuoc.jpg


with Power Query aka Get&Transform
Code:
// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    UOC = Table.UnpivotOtherColumns(Source, {"ID", "First Name", "Last Name", "Shift", "Department"}, "Attribute", "Value")
in
    UOC

Pivot Table (blue) is created from Query Table (green)
 
Last edited:
Upvote 0
@sandy666
Thank you for your prompt reply. Yes. The blue pivot table is what I'm looking for. Unfortunately, my information is not formatted like the green table you have displayed. Is there a way for me to convert, transpose my spreadsheet to to make it look like your green table? Currently, my information is formatted like my example with the column name and then marked with attributes.

I have over 300 employees that have different attributes and manually converting it seems overwhelming, but I fear I might have to do that so that I can get the pivot table you have created from the power query.

Let me know. I really appreciate your help.
 
Upvote 0
Below Pivot Table (blue) you can see M-code (Power Query aka Get&Transform) which create green table
so you can stay with green table or create Pivot Table from Query Table

again:
Code:
// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    UOC = Table.UnpivotOtherColumns(Source, {"ID", "First Name", "Last Name", "Shift", "Department"}, "Attribute", "Value")
in
    UOC

select your source table
from Data tab select From Table (it will open Power Query Editor)
select columns with Ctrl key: ID, First Name, Last Name, Shift, Department
from menu find: Transform - Unpivot Columns - Unpivot Other Columns
 
Last edited:
Upvote 0
continue from above...
then Close&Load To...
choose Connection Only
Ok
then
Insert - Pivot Table
qtpt.jpg

choose Query Table suitable to yours
and set layout of Pivot Table as you wish
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,841
Members
449,051
Latest member
excelquestion515

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