Forum Discussion
How to handle rows shifting after updating filtered data
Hi! Recently, Twifoo helped me return filtered data from an employee list to use it for other administrative purposes. However, I've added additional columns to the other sheets that use the filtered data and now, everytime I update the employee list, my other sheets shift up a row and the rest of the columns' data gets out of sync.
The employee list, which acts as the source data for all employees, is in the Employees sheet and includes 5 columns: ID, Employee Name, Status, Shift, and Work Days.
All other sheets use the ID column to bring only "Active" employees with this formula:
=IFERROR(INDEX(EmployeeTable[ID],AGGREGATE(15,6,EmployeeTable[ID]/(EmployeeTable[Status]="Active"),ROW()-1)),"")
After that, I use the ID column to bring up the corresponding Employee Names with this formula:
=IF([ID]="","",LOOKUP([ID],EmployeeTable[ID]:EmployeeTable[Employee Name]))
Apart from those two columns, all other columns are affected when I mark an employee as "Non Active".
How can I improve my formulas or my column structure to prevent this shifting data? I'm attaching an example workbook with the same structure mentioned.
Thanks
4 Replies
- TwifooSilver Contributor
Please specify in which cells do you need help with and what are your expected results in each of those cells.
- emilioramirezzCopper Contributor
I'd like to be able to update Status (Employee sheet > Column C) from "Active" to "Not Active" and not offset/shift/alter the data in Columns C, D, E, F, etc. in my other sheets. So, if I have an EmployeeTable with 5 employees and their respective salaries
EmployeeTable
ID Employee Name Status
001 A Active 002 B Active 003 C Active 004
D Active 005
E Active SalaryTable
ID Employee Name Weekly Salary 001 A $10 002 B $20 003 C $30 004 D $40 005 E $50 And the following week I have to mark employee B as "Not Active" because he resigned
ID Employee Name Status 001 A Active 002 B Not Active 003 C Active 004 D Active 005 E Active Not have it mess up everyone else's salaries
ID Employee Name Weekly Salary 001 A $10 003 C $20 004 D $30 005 E $40 $50 - TwifooSilver Contributor
In the attached file, the formula for Days Worked is:
=SUMPRODUCT((AttendanceTable[ID]=[@ID])*
(AttendanceTable[RH-Thursday]:AttendanceTable[TH-Wednesday]>0))For Regular Hours, the formula is:
=INDEX(MMULT(--AttendanceTable[RH-Thursday]:AttendanceTable[TH-Wednesday],
{1;0;0;1;0;0;1;0;0;1;0;0;1;0;0;1;0;0;1;0;0}),
MATCH([@ID],AttendanceTable[ID],0))For Regular Hour Salary, the formula is:
=[@[Regular Hours]]*
LOOKUP([@ID],SalaryTable[ID]:SalaryTable[Regular Hour])The succeeding formulas follow the same logic as the foregoing.