Hello,
I have a list of cities with distances and travel times between them. Postal Code is only for further identification of the city or city part. The table looks like this (with a total of 60000 rows):
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Postal Code 1[/TD]
[TD]City 1[/TD]
[TD]Postal Code 2[/TD]
[TD]City 2[/TD]
[TD]Distance(km)[/TD]
[TD]Travel time(minutes)[/TD]
[/TR]
[TR]
[TD]10000[/TD]
[TD]Prague[/TD]
[TD]61700[/TD]
[TD]Brno[/TD]
[TD]202[/TD]
[TD]117[/TD]
[/TR]
[TR]
[TD]10000[/TD]
[TD]Prague[/TD]
[TD]70030[/TD]
[TD]Ostrava[/TD]
[TD]364[/TD]
[TD]202[/TD]
[/TR]
[TR]
[TD]77900[/TD]
[TD]Olomouc[/TD]
[TD]70030[/TD]
[TD]Ostrava[/TD]
[TD]90[/TD]
[TD]60[/TD]
[/TR]
</tbody>[/TABLE]
In the first 2 columns I have a set of only 18 big cities with which I want to compare the rest of the cities (about 3300) in the next 2 columns.
What I want to achieve is when I enter a Postal Code, I would like Excel to check column "Postal Code 2" for all instances of this number and then find the corresponding smallest travel time (Minimum Value in column F). Once I find the minimum value (basically it says what is the shortest travel time from the chosen city to one of the 18 big cities), I would like to also get the Postal Code 1 and City 1 and the Distance, so I know to which city pair the minimum travel time belongs and also what is the distance between them.
So, for example in this simplified 3-row table, if I enter Postal Code for Ostrava = "70030", I would like the result to be:
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]77900[/TD]
[TD]Olomouc[/TD]
[TD]90[/TD]
[TD]60[/TD]
[/TR]
</tbody>[/TABLE]
...because for this Postal Code the shortest travel time is 60 minutes, takes 90 kilometers and goes to the city of Olomouc with Postal Code 77900.
For my full big list with 60k rows, I also want to have the same output for the 2nd and 3rd shortest travel time, so the output table would have 4 columns and 3 rows (4x3).
---
So far I have tried the "MINIFS" function, with which I can find the shortest travel time given the criteria. To get 2nd and 3rd shortest travel time, I could use a combination of functions LARGE and IF.
What I am stuck on is how to also get the additional and identifying information (Postal Code 1, City 1, Distance) which corresponds to the shortest travel time and not just the single value, basically achieving the 4x3 table mentioned above. Please help
If something is unclear or you need more info to be able to help solve this, please ask and I will try to clear it up.
I have a list of cities with distances and travel times between them. Postal Code is only for further identification of the city or city part. The table looks like this (with a total of 60000 rows):
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Postal Code 1[/TD]
[TD]City 1[/TD]
[TD]Postal Code 2[/TD]
[TD]City 2[/TD]
[TD]Distance(km)[/TD]
[TD]Travel time(minutes)[/TD]
[/TR]
[TR]
[TD]10000[/TD]
[TD]Prague[/TD]
[TD]61700[/TD]
[TD]Brno[/TD]
[TD]202[/TD]
[TD]117[/TD]
[/TR]
[TR]
[TD]10000[/TD]
[TD]Prague[/TD]
[TD]70030[/TD]
[TD]Ostrava[/TD]
[TD]364[/TD]
[TD]202[/TD]
[/TR]
[TR]
[TD]77900[/TD]
[TD]Olomouc[/TD]
[TD]70030[/TD]
[TD]Ostrava[/TD]
[TD]90[/TD]
[TD]60[/TD]
[/TR]
</tbody>[/TABLE]
In the first 2 columns I have a set of only 18 big cities with which I want to compare the rest of the cities (about 3300) in the next 2 columns.
What I want to achieve is when I enter a Postal Code, I would like Excel to check column "Postal Code 2" for all instances of this number and then find the corresponding smallest travel time (Minimum Value in column F). Once I find the minimum value (basically it says what is the shortest travel time from the chosen city to one of the 18 big cities), I would like to also get the Postal Code 1 and City 1 and the Distance, so I know to which city pair the minimum travel time belongs and also what is the distance between them.
So, for example in this simplified 3-row table, if I enter Postal Code for Ostrava = "70030", I would like the result to be:
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]77900[/TD]
[TD]Olomouc[/TD]
[TD]90[/TD]
[TD]60[/TD]
[/TR]
</tbody>[/TABLE]
...because for this Postal Code the shortest travel time is 60 minutes, takes 90 kilometers and goes to the city of Olomouc with Postal Code 77900.
For my full big list with 60k rows, I also want to have the same output for the 2nd and 3rd shortest travel time, so the output table would have 4 columns and 3 rows (4x3).
---
So far I have tried the "MINIFS" function, with which I can find the shortest travel time given the criteria. To get 2nd and 3rd shortest travel time, I could use a combination of functions LARGE and IF.
What I am stuck on is how to also get the additional and identifying information (Postal Code 1, City 1, Distance) which corresponds to the shortest travel time and not just the single value, basically achieving the 4x3 table mentioned above. Please help
If something is unclear or you need more info to be able to help solve this, please ask and I will try to clear it up.