Hi, Bros.
I am having trouble coming up with a formula and was wondering if I could get some assistance/advice.
I have 2 sheets, "Data" and "Sheet1".
The sheet "Data" have 100000 rows with data from column B to column H.
[TABLE="width: 182"]
<colgroup><col><col span="7"></colgroup><tbody>[TR]
[TD]ID1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]8[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]ID2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]3[/TD]
[TD]5[/TD]
[TD]9[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]ID3[/TD]
[TD]7[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]6[/TD]
[TD]8[/TD]
[TD]6[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]ID4[/TD]
[TD]1[/TD]
[TD]6[/TD]
[TD]7[/TD]
[TD]9[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]ID5[/TD]
[TD]4[/TD]
[TD]7[/TD]
[TD]0[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]3[/TD]
[TD]6[/TD]
[/TR]
</tbody>[/TABLE]
The cell (A2) and cell (B1) in sheet "Sheet1" are the criteria.
A2 =1, B1 =0
How to transform the code below into VBA Code (or another method)?
In sheet 1 Cell(2,2) =
IF(COUNTIF(Data!$1:$1,$A2)=0,0,COUNTIF(Data!$1:$1,B$1))+
IF(COUNTIF(Data!$2:$2,$A2)=0,0,COUNTIF(Data!$2:$2,B$1))+
IF(COUNTIF(Data!$3:$3,$A2)=0,0,COUNTIF(Data!$3:$3,B$1))+
.
.
.
IF(COUNTIF(Data!$10000:$10000,$A2)=0,0,COUNTIF(Data!$10000:$10000,B$1))
Thank you very much.
I am having trouble coming up with a formula and was wondering if I could get some assistance/advice.
I have 2 sheets, "Data" and "Sheet1".
The sheet "Data" have 100000 rows with data from column B to column H.
[TABLE="width: 182"]
<colgroup><col><col span="7"></colgroup><tbody>[TR]
[TD]ID1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]8[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]ID2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]3[/TD]
[TD]5[/TD]
[TD]9[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]ID3[/TD]
[TD]7[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]6[/TD]
[TD]8[/TD]
[TD]6[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]ID4[/TD]
[TD]1[/TD]
[TD]6[/TD]
[TD]7[/TD]
[TD]9[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]ID5[/TD]
[TD]4[/TD]
[TD]7[/TD]
[TD]0[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]3[/TD]
[TD]6[/TD]
[/TR]
</tbody>[/TABLE]
The cell (A2) and cell (B1) in sheet "Sheet1" are the criteria.
A2 =1, B1 =0
How to transform the code below into VBA Code (or another method)?
In sheet 1 Cell(2,2) =
IF(COUNTIF(Data!$1:$1,$A2)=0,0,COUNTIF(Data!$1:$1,B$1))+
IF(COUNTIF(Data!$2:$2,$A2)=0,0,COUNTIF(Data!$2:$2,B$1))+
IF(COUNTIF(Data!$3:$3,$A2)=0,0,COUNTIF(Data!$3:$3,B$1))+
.
.
.
IF(COUNTIF(Data!$10000:$10000,$A2)=0,0,COUNTIF(Data!$10000:$10000,B$1))
Thank you very much.