User Profile
RandomPanda
Brass Contributor
Joined 4 years ago
User Widgets
Recent Discussions
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.541Views0likes2CommentsVBA to automate field updates
I am looking for some generic VBA code that will allow me to automatically adjust a couple fields based on others for a set number of lines. What I want, in laymen's terms is: 1. Pop-up to enter the number of "lots" (see screenshot) I want to adjust 2. For that many lots, adjust column F to add the amount in G (F is currently not a formula, so manually, I do an "<F2>, +1, <Home>, =, <tab>" - I want it to do this so I can see the new formula versus just adding the fields like in another VBA project I have). 3. For the same amount of lots, I need to adjust the weight in col P by adding the number in G * the average weight in col Q. Again, P is not a formula now, so I manually do "<F2>, +1*219, <Home>, =, <tab> From my limited experience writing these I assume it would look similar to this: X = entered number of lots (array) Diff = col G Avg = col Q For x lots, F = F+Diff For x lots, P = P+Diff*Avg The lot number, which could be utilized to define/compare X is in column D. So, we could use an "If col D is IN the entered lot array" - say I enter 1 as the starting and 9 as the ending lot in the pop-up - THEN ... run the formulas. This way, if I want to adjust, say lots 16-22 or only lot 40, the IF-statement will only look for and adjust those lots. So, the beginning and ending lots should be able to be the same number. And, the search for lot numbers should be D2-D60 with error handling for no entry (I generally have 35-50 lots, but could be more or less). Thank you in advanceSolved584Views0likes3CommentsWorksheets("xx").Activate - breaks macro
I have a file with a well-established macro that I wrote years ago. It's a file I reset (with macro button) and then SAVE AS for the new date. I use it daily. For some reason, today the macro throws a run-time error - Automation error, invalid forward reference, or reference to uncompiled type. When I click on debug, it's highlighting [ Worksheets("Tally_Summary").Activate ]. I never change the sheet names, so it's not that. It's not already on that sheet, so it's not that. I've tried closing the file, restarting my computer, opening an older version (previous date) and nothing seems to work. Quick update: just noticed something that happened yesterday as well. Even though it is a macro-enabled workbook, clicking on the macro dialog box shows no available macros. So, THAT is probably the main issue. I have another file that did this yesterday and I couldn't save the file at all.1.6KViews0likes6CommentsPivot Table - 2 criteria but show only one
I have a labor file with data source sorted by several criteria including Employee ID and then by Pay Code (Regular Hours, OT hours, PTO, etc.). I have a Pivot Table that pulls from that based on Labor Assignment first - A Shift, B Shift, A Shift 2nd Location, B Shift 2nd Location, ... And then pulls the Employee Name and total regular hours (Pivot Table has a manual filter for that Pay Code). My problem is I have two employees with the same name, but different Employee ID's (actually have a few of these "duplicates") who work under the same Labor Assignment. I want the table to sort them out by Employee ID, but only show the name in the results. for example: A Shift - Employee ID 1234 - John Smith 8 hours A Shift - Employee ID 2345 - John Smith 8.5 hours I want the table to output: A Shift John Smith 8 hours John Smith 8.5 hours Right now it is showing John Smith 16.5 hours or John Smith 1234 8 hours John Smith 2345 8.5 hours Is it possible to sort on a field but not show it in the table? Perhaps, do I need to do something with the source data as far as sorting or adding a column? Thanks in advance. p.s. - don't want / can't use Power Query due to constraints at work.Solved2.9KViews0likes3CommentsTwo file questions: SAVE and Link
I have two odd things happening that I'm trying to figure out. They are really just annoyances, but I'm a perfectionist and would like to clear these up. 1. A file I'm opening shows [Linking: "Prod0629.xls"] in the bottom as Excel is trying to open. But, I can't figure out where Prod 0629 is being referenced in the file. Is there a way to see that so I can remove it? Working from home (over VPN) takes forever to open the file since it's linked to an external file (plus all the other formulas and valid linkages that are in the file). 2. Another file I have is constantly asking me to Save when I close it, even though I haven't changed anything. It's the only file doing this that I use on a daily basis. It is a Macro Enabled Worksheet (just a reset) and I copy/paste special (123) some info in there. I just can't figure out why, after 3 seconds of going to another file and coming back to it to close, it asks if I want to save. It does not have any linked fields to outside data. Thanks for the help.443Views0likes0CommentsFor Loop select range to clear contents
I have a FOR loop that is combining values with duplicate identifiers in a few different columns but I'm having trouble clearing contents of just the cells I want to get rid of. I don't want to delete the whole row, just clear the contents of specific cells in that row. I can't figure out the syntax to select Columns A-G for Row(r) - where "r" is the row the FOR loop is on. Can you help? For r = m - 1 To 2 Step -1 If Range("A" & r + 1).Value = Range("A" & r).Value Then Range("C" & r + 1).Value = Range("C" & r).Value + Range("C" & r + 1).Value Range("E" & r + 1).Value = Range("E" & r).Value + Range("E" & r + 1).Value Range("F" & r + 1).Value = Range("F" & r).Value + Range("F" & r + 1).Value Range("G" & r + 1).Value = Range("G" & r).Value + Range("G" & r + 1).Value Range("A"&r:"G"&r).ClearContents End IfSolved1.2KViews0likes2CommentsPivot Table Default Filter
Found an old thread withhttps://support.office.com/en-us/article/Set-PivotTable-default-layout-options-efd8569c-f07a-43c1-9db2-4f2912a0f94e showing setting defaults for Pivot Tables, but after a short time reviewing it looks to be more layout defaults rather than filter defaults. So, this is probably not an option - logically, absent data can't be filtered. But, is there a way to set filters to a specific value that I know will be in the data once I paste it into the table? For example - a labor file is blank until I download and manipulate the data (clearing out blanks and adjusting any "N/A" fields). Once in the correct format and free of invalid data, I copy/paste into the pivot tables data set. I know that "Regular Worked Hours" will be in the data set and I have several pivot tables fordifferent departments. Is there a way to set the default for each of these tables to only include Regular Worked Hours so all I need to do is refresh once the data is copied over to the table?3.7KViews0likes3CommentsAVERAGEIFS
Hopefully this is easy, but I just can't wrap my head around how long this formula (how many nested formulas) is going to be. Have a table (not named, but could be if easier) on one sheet ("Gang Time") with column D blank and column E with a "sorting code". I need column D to look for the value in E on a different tab ("Total Labor"), column E, also (table it's looking in is A1:M5000). Then it needs to look at column K for "Regular Worked Hours", then in Column L and only return the value if it is greater than 3 and less than 13. The value returned needs to be added up for all matching sorting codes and return the average to 2 decimal places. So, if col E on "Gang Time" = 5, col D should average all "5's" in the table on "Total Labor" that are Regular Worked Hours between 3 and 13. Confusing enough? I'm assuming it's an IF(VLOOKUP,(IF(VLOOKUP,(IFVLOOKUP.......))))))))) Thanks in advance.Solved2KViews0likes4CommentsNeed VBA to auto-sum two fields
I'm fairly confident in my ability to edit VBA, but starting from scratch is a little more challenging. I have a file with production numbers, sorted by product code. The nature of my business is that some partial pallets get held to the next day in order to fill them to the top with product. So, for daily yields, I need to take out the previous day's production from today's numbers. So, my file contains code "1234" with "-1" pallet and "-500" lbs. and a second line (today's totals) with code "1234", "15" pallets and "15000" lbs. I want the macro to search for duplicate product codes, combine the two pallet and lb. numbers and then delete the line with the negative amounts. So the result of the below lines would be a single line showing 14 pallets and 14500 lbs. A B C D 1234 description -1 -500 1234 description 15 15000 of course, this would need to loop until no more duplicates are found. And, to add a snag, or error-handling, if there are no duplicates, but still have negatives in either pallet or weight field, it should ignore those (and I'll deal with them manually). Thanks in advance for any help you can offer.Solved1.5KViews0likes6Comments
Groups
Recent Blog Articles
No content to show