I have Object A and Object B, C, or D, I need this to produce value X related to the two objects I have

I’m building a game that has time trials in it where you start at object A, and the program randomly picks between B, C, or D and produces an “optimal” time to get from A to that object. Then I need to be able to do this for each of the other objects (i.e from B to either A,C, or D, or from C to either A, B, or D).
In other words I need a way to input two values:
(1. Object the player is currently at
2. object the player needs to get to)
and then have it return a set value based on those two specific objects.
The way I have been thinking to do this is a massive list of branches comparing all values but that seems completely inefficient especially considering I plan on having about 20 objects at the end of the game and all will have to be compared with each other. Does anybody have any ideas? I understand this may be confusing so if so I can reiterate to try and make it more clear.

Edit: I already considered data tables the issue is that you can only input the name of the row, and then all of the columns are output thus you cannot have an input for the column you need.

I figured it out using data tables. In case anybody finds the same problem it can be solved by getting the actor reference from both actors you need, getting the names of those actors, and then appending them onto each other. Then in your data table just name your rows as the two object names appended on each other. See pics below where the name of the actor for current objective is Home_Apartment and the name of the actors for the for previous objective are 1_A1_KendrasKorner, 1_A2_ChelsiesCoffee, etc etc . You can then get the distance and time for the two objects through splitting the “out row”

220413-targettimesanddiatancesexcel.jpg