Table Efficiency Cleanup

Pestomania

Active Member
Joined
May 30, 2018
Messages
332
Office Version
  1. 365
Platform
  1. Windows
Hi everyone!

I have the below data that I am hoping to clean up in the final table. We will use this table for supervisors and managers to identify how many employees are trained in each area. I added "Notes" in G11 about what I am hoping to get to, but have been unable to understand how to get to what I want (the highlighted green C14:E20). I have about 400 columns x 300 rows in this table that I am hoping to get cleaned up into a table like this. A pivot table didn't work because the count of columns does not work and I cannot figure out how to get down to a pivot table that looks similar to the table below.


Prestons Playground for Modeling.xlsx
ABCDEFGHIJKLMNOPQRSTUVWX
1EmployeeNoUDF_F_NAMEUDF_L_NAMEUDF_GRP_CRBUDF_GRP_GRPHUDF_GRP_OVENUDF_WV_LMUDF_WV_HMUDF_MACH_P1UDF_MACH_P2UDF_GRP_CRB_CERT_DATEUDF_GRP_CRB_CERT_LEVELUDF_GRP_GRPH_CERT_DATEUDF_GRP_GRPH_CERT_LEVELUDF_GRP_OVEN_CERT_DATEUDF_GRP_OVEN_CERT_LEVELUDF_WV_LM_CERT_DATEUDF_WV_LM_CERT_LEVELUDF_WV_HM_CERT_DATEUDF_WV_HM_CERT_LEVELUDF_MACH_P1_CERT_DATEUDF_MACH_P1_CERT_LEVELUDF_MACH_P2_CERT_DATEUDF_MACH_P2_CERT_LEVEL
21Person 1Person 1 LYYNNYNYNNNNYYNYNYNNNN
32Person 2Person 2 LYYNYNYNYNNYYYNYYNYNYN
43Person 3Person 3 LNYNYYYYNNNYNNNYNNYNNN
54Person 4Person 4 LNNYYNNNNNYYYYYNNNYYNN
6
7
8
9
10Work CenterDept_Code# Trained IndividualsNotes:
11#VALUE!#VALUE!#VALUE!I only want to show the Work Centers that start with "UDF_" and does not have more than 2 "_" in the statement (highlighted green). It would be great to make the table auto-update if a new column in the "Headers" was added that meet the guidelines. The table above is a SQL connection that gets refreshed regularly.
12F_NAMEF0
13L_NAMEL0
14GRP_CRBGRP2
15GRP_GRPHGRP3
16GRP_OVENGRP1
17WV_LMWV3
18WV_HMWV2
19MACH_P1MACH2
20MACH_P2MACH2
21GRP_CRB_CERT_DATEGRP1
22GRP_CRB_CERT_LEVELGRP0
23GRP_GRPH_CERT_DATEGRP1
24GRP_GRPH_CERT_LEVELGRP3
25GRP_OVEN_CERT_DATEGRP3
26GRP_OVEN_CERT_LEVELGRP3
27WV_LM_CERT_DATEWV1
28WV_LM_CERT_LEVELWV3
29WV_HM_CERT_DATEWV1
30WV_HM_CERT_LEVELWV1
31MACH_P1_CERT_DATEMACH3
32MACH_P1_CERT_LEVELMACH1
33MACH_P2_CERT_DATEMACH1
34MACH_P2_CERT_LEVELMACH0
Sheet8
Cell Formulas
RangeFormula
C11:C34C11=TRANSPOSE(CHOOSEROWS(UNIQUE(MID(JT_Employee[#Headers],FIND("_",JT_Employee[#Headers])+1,LEN(JT_Employee[#Headers])-4)),ROWS($E$11:$E11)))
D11:D34D11=LEFT(C11,FIND("_",C11)-1)
E11:E34E11=COUNTIFS(INDIRECT("JT_Employee[UDF_"&SUBSTITUTE(C11,"-","_")&"]"),"Y")
Dynamic array formulas.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
How about
Fluff.xlsm
CDE
10Work CenterDept_Code# Trained Individuals
11F_NAMEF0
12L_NAMEL0
13GRP_CRBGRP2
14GRP_GRPHGRP3
15GRP_OVENGRP1
16WV_LMWV3
17WV_HMWV2
18MACH_P1MACH2
19MACH_P2MACH2
20
Data
Cell Formulas
RangeFormula
C11:C19C11=LET(h,TOCOL(UNIQUE(TEXTAFTER(JT_Employee[#Headers],"_")),2),FILTER(h,LEN(h)-LEN(SUBSTITUTE(h,"_",""))=1))
D11:D19D11=TEXTBEFORE(C11#,"_")
E11:E19E11=COUNTIFS(INDIRECT("JT_Employee[UDF_"&C11#&"]"),"Y")
Dynamic array formulas.
 
Upvote 0
This did great! Is there a way to remove the F_Name, L_Name, and Operator_Group? If not, that's fine but this is amazing!
 
Upvote 0
Will it always be the 1st 3 columns to ignore?
 
Upvote 0
Will it always be the 1st 3 columns to ignore?
Unfortunately, not. The actual table has these fields at the beginning of the table:

EmployeeNoUDF_LOCATIONFacilityHireDateUDF_EFFICIENCYUDF_F_NAMEUDF_L_NAMEUDF_OPERATOR_GROUPUDF_SCHEDULEUDF_MACHINEUDF_TYPE

I don't suspect any new fields will be added that meet the criteria of 2 underscores. I think if I can filter those out manually, that would be fine.
 
Upvote 0
Is there a specific column name that will always be the 1st to look at?
 
Upvote 0
I meant the first you want to include.
 
Upvote 0
Ok, how about
Fluff.xlsm
CDE
10Work CenterDept_Code# Trained Individuals
11DENS_CARBDENS2
12GRP_GRPHGRP3
13GRP_OVENGRP1
14WV_LMWV3
15WV_HMWV2
16MACH_P1MACH2
17MACH_P2MACH2
18
Data
Cell Formulas
RangeFormula
C11:C17C11=LET(h,TOCOL(UNIQUE(DROP(TEXTAFTER(JT_Employee[#Headers],"_"),,XMATCH("udf_dens_carb",JT_Employee[#Headers])-1)),2),FILTER(h,LEN(h)-LEN(SUBSTITUTE(h,"_",""))=1))
D11:D17D11=TEXTBEFORE(C11#,"_")
E11:E17E11=COUNTIFS(INDIRECT("JT_Employee[UDF_"&C11#&"]"),"Y")
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,181
Members
452,615
Latest member
bogeys2birdies

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