Table Efficiency Cleanup

Pestomania

Active Member
Joined
May 30, 2018
Messages
292
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.
 
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.
Is there a way to say if it has greater than 1 underscore, but does not end with the words date or level? I changed the filter to greater than 1 but am at a lost on the date or level words.

Excel Formula:
=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))
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Can you post some sample data.
 
Upvote 0
Hi, here are a few of the column names. I would only want to return any that do not end with "data" or "level". It would be great if for some reason in the future, there are other words to ignore, I could add those.

Training Cert Excel Export.xlsx
CDCECFCGCHCI
1UDF_PLA_XRAYUDF_EOP_READINGUDF_WVE_PLA_CERT_DATEUDF_WVE_PLA_CERT_LEVELUDF_EOP_LIND_CERT_DATEUDF_EOP_READING_CERT_DATE
JT_Employee_Data_Table
 
Upvote 0
That doesn't make sense if you are excluding columns with more than 1 underscore after the UDF_ as they will be excluded any way.
 
Upvote 0
Sorry, I didn't add any of the new columns. Our safety department added these fields that need to be in there but because of the number of underscores, it doesn't work. That is why I was thinking if I can filter out items that have certain endings, that would bypass the underscore issue.


Training Cert Excel Export.xlsx
HAHBHCHDHEHFHGHH
1UDF_SAFE_LASER_CLSSUDF_SAFE_LASER_HNDS_ONUDF_SAFE_LOTO_CLSSUDF_SAFE_LOTO_HNDS_ONUDF_SAFE_LOTO_SRL_NMUDF_SAFE_PWR_TRCK_CLSSUDF_SAFE_PWR_TRCK_HNDS_ONUDF_SAFE_RAD_SFTY_CLSS
JT_Employee_Data_Table
 
Upvote 0
How about
Excel Formula:
=LET(h,TOCOL(UNIQUE(DROP(TEXTAFTER(JT_Employee[#Headers],"_"),,XMATCH("udf_dens_carb",JT_Employee[#Headers])-1)),2),FILTER(h,(TEXTAFTER(h,"_",-1)<>"Date")*(TEXTAFTER(h,"_",-1)<>"level")))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,223
Messages
6,123,714
Members
449,118
Latest member
MichealRed

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