Hello, I would like to know if it would be possible to use the IFERROR, INDEX, MATCH function on below scenario.
Based on the data of Countries and Cities filled in yellow on the left, by using the IFERROR, INDEX, MATCH formula I managed to get all the data I need. But since I limited the amount of column into 3, what if there are more than 3 City. What I want is for the excel to continue the list of cities by creating another row under it as example of row filled in red.
I hope it makes sence. Let me know if it's possible.
Book1 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | Country | City | Image | Country | City1 | City2 | City3 | Image1 | Image2 | Image3 | ||
2 | France | Paris | Paris_France_xxx.jpg | France | Paris | Paris_France_xxx.jpg | ||||||
3 | Canada | Toronto | Toronto_Canada_xxx.jpg | Canada | Toronto | Montreal | Toronto_Canada_xxx.jpg | Montreal_Canada_yyy.jpg | ||||
4 | Canada | Montreal | Montreal_Canada_yyy.jpg | USA | Chicago | Boston | Miami | Chicago_USA_xxx.jpg | Boston_USA_yyy.jpg | Miami_USA_zzz.jpg | ||
5 | USA | Chicago | Chicago_USA_xxx.jpg | UK | London | Liverpool | Manchester | London_UK_xxx.jpg | Liverpool_UK_yyy.jpg | Manchester_UK_zzz.jpg | ||
6 | USA | Boston | Boston_USA_yyy.jpg | UK | Cambridge | Cambridge_UK_aaaa.jpg | ||||||
7 | USA | Miami | Miami_USA_zzz.jpg | Japan | Tokyo | Kyoto | Osaka | Tokyo_Japan_xxx.jpg | Kyoto_Japan_yyy.jpg | Osaka_Japan_zzz.jpg | ||
8 | UK | London | London_UK_xxx.jpg | Japan | Yokohama | Nagoya | Yokohama_Japan_aaaa.jpg | Nagoya_Japan_bbbb.jpg | ||||
9 | UK | Liverpool | Liverpool_UK_yyy.jpg | |||||||||
10 | UK | Manchester | Manchester_UK_zzz.jpg | |||||||||
11 | UK | Cambridge | Cambridge_UK_aaaa.jpg | |||||||||
12 | Japan | Tokyo | Tokyo_Japan_xxx.jpg | |||||||||
13 | Japan | Kyoto | Kyoto_Japan_yyy.jpg | |||||||||
14 | Japan | Osaka | Osaka_Japan_zzz.jpg | |||||||||
15 | Japan | Yokohama | Yokohama_Japan_aaaa.jpg | |||||||||
16 | Japan | Nagoya | Nagoya_Japan_bbbb.jpg | |||||||||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D2:D5 | D2 | =INDEX($A$2:$A$16, MATCH(0, COUNTIF($D$1:$D1, $A$2:$A$16), 0)) |
E2:G5,E7:G7 | E2 | =IFERROR(INDEX($B$2:$B$16, MATCH(0, COUNTIF($D2:D2,$B$2:$B$16)+IF($A$2:$A$16<>$D2, 1, 0), 0)), "") |
H2:H5,H7 | H2 | =IFERROR(INDEX($C$2:$C$16, MATCH(0, COUNTIF($D2:D2,$C$2:$C$16)+IF($A$2:$A$16<>$D2, 1, 0), 0)), "") |
I2:J5,I7:J7 | I2 | =IFERROR(INDEX($C$2:$C$16, MATCH(0, COUNTIF($D2:H2,$C$2:$C$16)+IF($A$2:$A$16<>$D2, 1, 0), 0)), "") |
D7 | D7 | =INDEX($A$2:$A$16, MATCH(0, COUNTIF($D$1:$D5, $A$2:$A$16), 0)) |
Press CTRL+SHIFT+ENTER to enter array formulas. |
Based on the data of Countries and Cities filled in yellow on the left, by using the IFERROR, INDEX, MATCH formula I managed to get all the data I need. But since I limited the amount of column into 3, what if there are more than 3 City. What I want is for the excel to continue the list of cities by creating another row under it as example of row filled in red.
I hope it makes sence. Let me know if it's possible.