Macro to combine data under 3rd and 4th Column if condn satisfy for 1st , 2nd column
Hello Everybody, |
|
Good Morning!! |
|
I am looking for a macro which will combine the data available in 3rd and 4th Column if conditions satisfied for 1st and 2nd Column. |
Below Input and Output data for your reference..
INPUT |
|
|
|
|
|
KM |
Leg |
Org |
Dest |
|
|
2,019,769,184 |
1 |
BOM |
DEL |
|
|
2,019,769,184 |
2 |
DEL |
BLR |
|
|
2,019,770,095 |
1 |
BOM |
MAA |
|
|
2,019,770,675 |
2 |
MAA |
DEL |
|
|
2,019,770,213 |
1 |
SXR |
IXJ |
|
|
2,019,770,213 |
2 |
IXJ |
DEL |
|
|
2,019,770,213 |
3 |
DEL |
BOM |
|
|
2,019,770,213 |
4 |
BOM |
SXR |
|
|
2,019,770,816 |
2 |
DEL |
MAA |
|
|
2,019,770,816 |
3 |
MAA |
IXC |
|
|
|
|
|
|
|
|
OUTPUT |
|
|
|
|
Rule |
KM |
Leg |
Org |
Dest |
OUTPUT |
|
2,019,769,184 |
1 |
BOM |
DEL |
BOM - DEL - BLR |
KM are same for Leg 1 & 2 hence Org and Dest combined in column E |
2,019,769,184 |
2 |
DEL |
BLR |
|
|
2,019,770,095 |
1 |
BOM |
MAA |
BOM - MAA |
KM is only one and not matching with any one hence Org and Dest taken as it is in column E |
2,019,770,675 |
2 |
MAA |
DEL |
MAA - DEL |
KM is only one and not matching with any one hence Org and Dest taken as it is in column E |
2,019,770,213 |
1 |
SXR |
IXJ |
SXR - IXJ - DEL - BOM - SXR |
KM are same for Leg 1, 2, 3 & 4 hence Org and Dest combined in column E |
2,019,770,213 |
2 |
IXJ |
DEL |
|
|
2,019,770,213 |
3 |
DEL |
BOM |
|
|
2,019,770,213 |
4 |
BOM |
SXR |
|
|
2,019,770,816 |
2 |
DEL |
MAA |
DEL - MAA - IXC |
KM are same for Leg 2 & 3 hence Org and Dest combined in column E |
2,019,770,816 |
3 |
MAA |
IXC |
|
|
2,019,770,800 |
6 |
KLH |
BOM |
KLH - BOM |
KM is only one and not matching with any one hence Org and Dest taken as it is in column E |
Thank You,
Shan
1 Attachment(s)
Macro to combine data under 3rd and 4th Column if condn satisfy for 1st , 2nd column
Please find attached excel for more understanding...