Forum Discussion
I need a formula or pivot table or something to pull info based on several factors
Ok, I thought I could just do this via vlookup, but I'm having trouble figuring out all the logic and syntax to it. Can I create a pivot table based on multiple tables? Automatic Data Analysis (that's something I haven't looked into, yet, and don't know much about)?
Here's what I have:
Two tables -
1. Employee data in columns A:R (showing alpha column and column reference for vlookup)
Date in col A (column ref 1)
Name in col C (column ref 3)
Emp ID in col D (column ref 4)
Cost Center in col F (column ref 6)
Work Center in col G (column ref 7) - may be blank or no matching value found
Hours in col M (column ref 13)
Hours type (Regular Hours, Overtime, etc.) in col O (column ref 15)
2. Work center and gang times (standard hours for day)
Row 7 column C through column H has dates of the week (i.e. 8/5/24, 8/6/24, etc.)
starting in Row 8 through row 50 column A has a Work center
columns C through H has the daily gang time for that work center
What I need to compare and data I need at the end:
Basically, I need to check if an employee has more regular hours than what the gang time shows. I'll need to return the Date, Employee Name, Emp ID, Cost Center, Work Center and regular hours worked plus the static gang time for that work center for the day in order to visually show the variance.
So, output should just be a table of those employees whose timesheet has more hours than the standard for that day. no blank lines - not wanting to just look at the same row each time.
Here's an example of the output
I've attached a sample doc for your visualization of the input data.
Thank you, in advance, for any help you can provide.
2 Replies
- Rodrigo_Iron Contributor
RandomPanda
First unpivot the Gang Times Data to have a single column for dates and gang times using Power Query and insert an additional column before gang times column "Date_WorkCenter"and on Employee Data sheet, a helper column for "Date_WorkCenter", Gang Time, and Variance were also added,
on EE time > gang
I used filter functions to return multiple arrays (I used name range for the ranges of your employee data)
here's the sample data > employee time.xlsx- RandomPandaBrass ContributorThank you, Rodrigo. In looking at this, it doesn't appear to be dynamic...meaning, I need to be able to add data each day and have the output update. Additionally, I have several other pivot tables on separate sheets (for different supervisors) that use the same employee data. Since it is timesheet data (pulled from our punch clocks system) two things gum up the issues, here. First, missing punches (In/out/lunch, etc.) are fixed by the supervisor during the week. So, each day, I am pulling this data for Monday through today to catch anything that was missing previously. Second, obviously, the data is always the same format when I download. Right now, I just paste special over the data and my table updates all the pivot tables. The four rightmost columns are pulling from another table of a kind of "legend" for what the hours are and how they're paid. If I add columns or concatenate columns, a lot of other data could be corrupted...well, invalid. So, I'd like to put all this on a separate worksheet, referencing the other sheets. Could this just be a giant If/then, v/xlookup formula? I don't see it being that "easy".