# Group column data

#### Vijayarc

##### Member
Hi Ninja
Below is my sample data,
Column A in one CaseID have multiple ClientID in column B, below are my requirement is,
1. when caseid is not repeated ( have single Client id ) -> My comment be - Good to Off
2. when caseid is repeated ( have multiple Client id) -> my comment be - WIP-Partial Complete

Hope my requirements are clear, please help to do Automate in VBA , it will help to automate for my large data

 Case ID Client ID COMMENT 750408 875606162 Good to OFF 44830608 186729268 WIP-partial Complete 44830608 142408 WIP-partial Complete 44830608 181608 WIP-partial Complete 44830608 182108 WIP-partial Complete 44830608 231608 WIP-partial Complete 44830608 306108 WIP-partial Complete 44830608 456708 WIP-partial Complete 395692641 576408 Good to OFF 221865526 598408752 WIP-partial Complete 221865526 604408 WIP-partial Complete 221865526 616708 WIP-partial Complete 95108508 662408 Good to OFF 186109889 663808 WIP-partial Complete 186109889 666908 WIP-partial Complete 186729268 5895521245 Good to OFF

#### Marc L

##### Excel Ninja
Hi,​
why a VBA procedure as it can be easily achieved with an Excel beginner level formula ?!​

#### Vijayarc

##### Member
Hi Marc, , i done by formula =IF(COUNTIF(B:B,B121)>1,"Duplicate","Unique")
My caseID is repeats , here i taken only duplicate cases
please find the below 3 different conditions bases on D & E Column combination
1. If D column = NA and E column = Duplicate , So comment as Good to off
2. If D column <> NA and E column = Duplicate , So comment as WIP
3. If D column is mix of both "NA" and Number for same Caseid , so Comment as WIP-Partial complete

 CASID Client ID Combination CDGL Lookup CaseID Duplicate Comments 222454699​ 9370068221 2224546999370068221 NA Duplicate Good to offboard 222454699​ 9370068287 2224546999370068287 NA Duplicate Good to offboard 222454699​ 9370068221 2224546999370068221 NA Duplicate Good to offboard 222454699​ 9370068287 2224546999370068287 NA Duplicate Good to offboard 222454699​ 9370068221 2224546999370068221 2224546999370068221 Duplicate wip 222454699​ 9370068287 2224546999370068287 2224546999370068287 Duplicate wip 222454699​ 9370068221 2224546999370068221 2224546999370068221 Duplicate wip 222454699​ 9370068287 2224546999370068287 2224546999370068287 Duplicate wip 222454699​ 9370068221 2224546999370068221 NA Duplicate WIP- Partial completed 222454699​ 9370068287 2224546999370068287 2224546999370068287 Duplicate WIP- Partial completed 222454699​ 9370068221 2224546999370068221 NA Duplicate WIP- Partial completed 222454699​ 9370068287 2224546999370068287 2224546999370068287 Duplicate WIP- Partial completed

#### S. Das

##### Active Member
Vijayarc
please find the below 3 different conditions bases on D & E Column combination
1. If D column = NA and E column = Duplicate, So comment as Good to off
Then for the below caseid comment should be Good to offboard instead of WIP- Partial completed.

 CASID Client ID Combination CDGL Lookup CaseID Duplicate Comments 222454699 9370068221 2224546999370068221 NA Duplicate WIP- Partial completed

#### Marc L

##### Excel Ninja
If D column = NA
Why this is not explained in the initial post ?‼ You can't change the rules like this …​
Anyway you can use the ISNA worksheet function.​
Once you get your working formula, as per Excel basics transform your data range as a true Excel table - see Excel help - then​
each time you add a row to this Excel table the formula is automatically added without any VBA procedure !​
Before to go on VBA side just better think first of what Excel yet offers …​

#### Vijayarc

##### Member
Vijayarc

Then for the below caseid comment should be Good to offboard instead of WIP- Partial completed.

 CASID Client ID Combination CDGL Lookup CaseID Duplicate Comments 222454699 9370068221 2224546999370068221 NA Duplicate WIP- Partial completed
sorry for confusion , i try to clear.. please

Column A for one CaseID have multiple ClientID in column B

i do vlookup to D column with other file - if all ClientID is NA for same Caseid , then only i can Offboard, otherwise i cant
tricky 2 combination occurs

************** conditions ************
1. if all NA occurs for same Caseid - then comment is Good to Offboard
2. if mix of NA and number comes for same Caseid -i can't offboard so, comment is WIP-Partial