I have a dataset that looks like this:
| Loc 1 | Loc 2 | Loc 3 | Value |
| a | b | c | 1000 |
| d | e | f | 900 |
| a | g | h | 700 |
| g | h | f | 600 |
| o | g | h | 500 |
| i | i | j | 400 |
| i | j | o | 300 |
Imagine that I have teams and I need to assign places for them to go. Each team can go to a max of 3 locations and two teams can't be assigned to the same location.
So I want to find the combinations that are unique in its three locations
The rows are combinations of locations that already match the criteria required.
The value is just because I want to select the ones with the highest value ,so I sorted the combinations of three by value
In this example, the result would be:
| Loc 1 | Loc 2 | Loc 3 | Value |
| a | b | c | 1000 |
| d | e | f | 900 |
| o | g | h | 500 |
| i | i | j | 400 |
See that combinations may have only two locations (i,i,j)
So basically, for every row I need to look at the rows above and see if any of the locations in the current row is in any of the locations in the rows above. If it is, delete the row, if not keep it, then go to the next row. I am trying to use batch macro but I am new to it.
Can someone help me out?