Hello guys,
I am struggling with a formula, I cannot think of a way to create it in a way where it doesn't need any further manual intervention.
Tried with a pivot table but I can't seem to make GETPIVOTDATA to work.
Can you please help me out?
I have a database with Ref number/ week number / country / number
[TABLE="class: grid, width: 5, align: left"]
<tbody>[TR]
[TD]Table-1[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Country[/TD]
[TD]Ref Number[/TD]
[TD]Week Number[/TD]
[TD]#[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]UK[/TD]
[TD]123[/TD]
[TD]W26[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Germany[/TD]
[TD]445[/TD]
[TD]W26[/TD]
[TD]-12[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]UK[/TD]
[TD]123[/TD]
[TD]W27[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Netherlands[/TD]
[TD]555[/TD]
[TD]W27[/TD]
[TD]-12[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]UK[/TD]
[TD]342[/TD]
[TD]W28[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]
So I can have multiple countries with multiple ref numbers and in different weeks and on column D I can have only 12 or -12.
[TABLE="class: grid, width: 5, align: left"]
<tbody>[TR]
[TD]Table-2[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]UK[/TD]
[TD]W26[/TD]
[TD]W27[/TD]
[TD]W28[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]W26[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]W27[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]W28[/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
The Idea is to get a count based on week number how many ref numbers are in a recurrence in the following weeks. (E.G. Table 1 Cell B2 is in week 26 and it has a recurrence in week 27 also but in week 28 ref number 123 doesn't show up anymore so that's why it is 0 in table 2 cell D2.
In table 2 Cell B2,C3,D4 shows how many ref numbers do we have new in that week.
Can I get a formula that applies to Table 2 based on Table 1 database considering that I will need the formula to expand to week 52 on rows and columns and everything is based on country level?
Right now I am doing a formula with countifs(Table1!A:A,Table2!A1,Table1!C:C,Table2!B1,Table1!C:C,Table2!,C1) This is the formula for table 2 cell C2 and for further weeks I need to keep adding ,Table2!,D1 // ,Table2!,E1 and so on.
Thank you.
Razvan
I am struggling with a formula, I cannot think of a way to create it in a way where it doesn't need any further manual intervention.
Tried with a pivot table but I can't seem to make GETPIVOTDATA to work.
Can you please help me out?
I have a database with Ref number/ week number / country / number
[TABLE="class: grid, width: 5, align: left"]
<tbody>[TR]
[TD]Table-1[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Country[/TD]
[TD]Ref Number[/TD]
[TD]Week Number[/TD]
[TD]#[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]UK[/TD]
[TD]123[/TD]
[TD]W26[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Germany[/TD]
[TD]445[/TD]
[TD]W26[/TD]
[TD]-12[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]UK[/TD]
[TD]123[/TD]
[TD]W27[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Netherlands[/TD]
[TD]555[/TD]
[TD]W27[/TD]
[TD]-12[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]UK[/TD]
[TD]342[/TD]
[TD]W28[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]
So I can have multiple countries with multiple ref numbers and in different weeks and on column D I can have only 12 or -12.
[TABLE="class: grid, width: 5, align: left"]
<tbody>[TR]
[TD]Table-2[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]UK[/TD]
[TD]W26[/TD]
[TD]W27[/TD]
[TD]W28[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]W26[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]W27[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]W28[/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
The Idea is to get a count based on week number how many ref numbers are in a recurrence in the following weeks. (E.G. Table 1 Cell B2 is in week 26 and it has a recurrence in week 27 also but in week 28 ref number 123 doesn't show up anymore so that's why it is 0 in table 2 cell D2.
In table 2 Cell B2,C3,D4 shows how many ref numbers do we have new in that week.
Can I get a formula that applies to Table 2 based on Table 1 database considering that I will need the formula to expand to week 52 on rows and columns and everything is based on country level?
Right now I am doing a formula with countifs(Table1!A:A,Table2!A1,Table1!C:C,Table2!B1,Table1!C:C,Table2!,C1) This is the formula for table 2 cell C2 and for further weeks I need to keep adding ,Table2!,D1 // ,Table2!,E1 and so on.
Thank you.
Razvan