Hi,
Thanks for showing interest in this post.
I have 2 excel sheets one of which has entire database and 2nd sheet contains day-wise production data as below
Sheet 1: Database
<tbody>
</tbody>
Sheet 2: Day-Wise Production stats
<tbody>
</tbody>For this i am using 2 formulas (1st- to get a unique list of Emp_IDs who worked in the given task on a given day with this formula:
{=IFERROR(INDEX(Database[Emp_ID],
MATCH(0,
IF(Task Filter=Database[Task1],IF(Month Filter=Database[Month],COUNTIF($A$2:A2,Database[Emp_ID])),
IF(Task Filter=Database[Task2],IF(Month Filter=Database[Month],COUNTIF($A$2:A2,Database[Emp_ID])),
IF(Task Filter=Database[Task3],IF(Month Filter=Database[Month],COUNTIF($A$2:A2,Database[Emp_ID])),
""))),0)),"")}
And to calculate Production for the unique list for a particular task, i am using this below SUMIFS Array formula
{=IF(
(SUMIFS(Database[PD1],Database[Emp_ID],A3:A5,Database[Date],B2:B3,Database[Task1],$D$1)+
SUMIFS(Database[PD2],Database[Emp_ID],A3:A5,Database[Date],B2:B3,Database[Task2],$D$1)+
SUMIFS(Database[PD3],Database[Emp_ID],A3:A5,Database[Date],B2:B3,Database[Task3],$D$1)}
Now the challenge is that the database is huge (Almost 30000 Rows and 7 type of tasks) and these formulas are making the sheet too slow.
Please suggest if there is any fast way to do it. Or any VBA code. Actually i am new to VBA world. Thanks
Thanks for showing interest in this post.
I have 2 excel sheets one of which has entire database and 2nd sheet contains day-wise production data as below
Sheet 1: Database
Month | Date | Emp_ID | Emp_Name | Attendance Status | Task1 | Production for Task1 (PD1) | Task2 | Production for Task2 (PD2) | Task3 | Production for Task3 (PD3) |
June | 30/6/18 | 5673 | John | Present | Survey_1 | 30 | Survey_2 | 55 | Survey_1 | 37 |
June | 30/6/18 | 5675 | Michele | Present | Survey_1 | 27 | Survey_2 | 56 | ||
June | 30/6/18 | 5734 | Ethen | Present | Survey_3 | 56 | Survey_1 | 32 | ||
July | 01/7/18 | 5673 | John | Present | Survey_3 | 42 | ||||
July | 01/7/18 | 5675 | Michele | Present | Survey_1 | 53 | Survey_3 | 23 | Survey_1 | 113 |
July | 01/7/18 | 5734 | Ethen | Present | Survey_1 | 22 |
<tbody>
</tbody>
Sheet 2: Day-Wise Production stats
Month Filter | June | Task Filter | Survey_1 |
Emp_ID | 30/6/18 | 01/7/18 | 02/7/18 |
5673 | 67 | ||
5675 | 27 | 166 | |
5734 | 32 | 22 | |
<tbody>
</tbody>
{=IFERROR(INDEX(Database[Emp_ID],
MATCH(0,
IF(Task Filter=Database[Task1],IF(Month Filter=Database[Month],COUNTIF($A$2:A2,Database[Emp_ID])),
IF(Task Filter=Database[Task2],IF(Month Filter=Database[Month],COUNTIF($A$2:A2,Database[Emp_ID])),
IF(Task Filter=Database[Task3],IF(Month Filter=Database[Month],COUNTIF($A$2:A2,Database[Emp_ID])),
""))),0)),"")}
And to calculate Production for the unique list for a particular task, i am using this below SUMIFS Array formula
{=IF(
(SUMIFS(Database[PD1],Database[Emp_ID],A3:A5,Database[Date],B2:B3,Database[Task1],$D$1)+
SUMIFS(Database[PD2],Database[Emp_ID],A3:A5,Database[Date],B2:B3,Database[Task2],$D$1)+
SUMIFS(Database[PD3],Database[Emp_ID],A3:A5,Database[Date],B2:B3,Database[Task3],$D$1)}
Now the challenge is that the database is huge (Almost 30000 Rows and 7 type of tasks) and these formulas are making the sheet too slow.
Please suggest if there is any fast way to do it. Or any VBA code. Actually i am new to VBA world. Thanks