Group | B | C | Result |
A1 | A | 123 | |
A1 | # | 0 | |
A1 | A | 546 | |
A1 | # | 9 | |
A2 | A | 678 | 678 |
A2 | A | 678 | 678 |
A2 | # | 5 | 678 |
A3 | A | 532 | 532 |
A3 | # | 0 | 532 |
A3 | # | 0 | 532 |
Regarding the data presented above, I need to Count occurrences on columns B and C, inside each Group, in order to get the value in [C] to fill the column [D] with it.
the idea is to count the combinations of the 'A' values in column B, with the numerical values in column C - in 'A' + Value combinations - using the below criteria's:
- If there's only one 'A' in column B, the value to fill in column D is the correspondent value in the column C. This is the case of the Group (A3) with the value (532). Obviously, If this 'A' has no value on C, theres nothing to fill in column D.
- If there's 2 or more 'A' in Column B with the same values in column C, the value for filling in column D is the one that result from that combination. This is the case of Group (A2) with value (678).
Note : The Group (A1) will not be filled because, although it has 2 'A's, they have different combinations since they have divergent values in column C.
This process could be a vba Function that I'll include inside the main(), that will check those 2 combinations, and if the function returns no value - case of Group (A1) - the Main() process will perform analisys on those groups, reading them line by line.
Can anyone help please?