Hello,
Need help with Sumproduct to assign correct Dependent Number when there are twins.
I'm using the formula shown below but it produces two records with a Dep Number = 2.
But how can I get it to produce 2 then 3?
Many thanks in advance!
Formula:
=IF(D2="E",0,IF(D2="S",1,IF(AND(B3<>B2,OR(D2="D",D2="G")),SUMPRODUCT((A$2:A$65536=A2)*(D$2$65536="D")*(C$2:C$65536<C2))+SUMPRODUCT((A$2:A$65536=A2)*(D$2$65536="G")*(C$2:C$65536<C2))+2,"")))
Sample Data and results
EmployeeID First Name DOB Relation Dep Number
123456789 Joe 03/01/1987 D 2
123456789 Kevin 03/01/1987 D 2
123456789 Judy 12/01/2005 G 4
123456789 Cindy 04/17/1964 S 1
123456789 Tony 04/23/1960 E 0
Need help with Sumproduct to assign correct Dependent Number when there are twins.
I'm using the formula shown below but it produces two records with a Dep Number = 2.
But how can I get it to produce 2 then 3?
Many thanks in advance!
Formula:
=IF(D2="E",0,IF(D2="S",1,IF(AND(B3<>B2,OR(D2="D",D2="G")),SUMPRODUCT((A$2:A$65536=A2)*(D$2$65536="D")*(C$2:C$65536<C2))+SUMPRODUCT((A$2:A$65536=A2)*(D$2$65536="G")*(C$2:C$65536<C2))+2,"")))
Sample Data and results
EmployeeID First Name DOB Relation Dep Number
123456789 Joe 03/01/1987 D 2
123456789 Kevin 03/01/1987 D 2
123456789 Judy 12/01/2005 G 4
123456789 Cindy 04/17/1964 S 1
123456789 Tony 04/23/1960 E 0