Question: The solution I got currently prints the Input in the X shape from left to right but I needed it from top to bottom.

```
sentence = input("Insert your sentence")

def pattern(str, len):
    for i in range(0, len):

        j = len -1 - i
        for k in range(0, len):

            if (k == i or k == j):
                print(str[k],
                      end = "")
            else:
                print(end = " ")

        print(" ")

str = sentence
len = len(str)

pattern(str, len)

```

Using the input "Jonny" as an example with this solution:

```
J   y 
 o n  
  n   
 o n  
J   y 

```

The target output would be:

```
J   J 
 o o  
  n   
 n n  
y   y

```

Answer: 
Your options seem to be completely arbitrairy, and since the options under 'use' seem lineair to those, I'd suggest to use `CHOOSE()`:

[![enter image description here](https://i.stack.imgur.com/qZPvW.png)](https://i.stack.imgur.com/qZPvW.png)

Formula in `C2`:

```
=IFERROR(VLOOKUP(B2,E$2:M$4,CHOOSE(--MID(A2,5,99),2,4,5,8),0),"")

```

Dragged down...

---

The logic here is:

* `--MID(A2,5,99)` - Used to grab the number from the A-column. These seem to be lineair (or will result in an error if 'Unknown').
* The result of the above is input for the 1st parameter of `CHOOSE()`, and since they are lineair we can then write each value in the 2nd up to 5th parameter. Scale this if needed.
* The `VLOOKUP()` works as expected and should now return the columns as per outcome above.
* `IFERROR()` is there to catch any error given by 'Unknown'.

---

Since `BYROW()` appears to be in production, it won't harm to add the alternative to create a single formula for a spilling array. This would mean you only ever need to adjust a single formula:

[![enter image description here](https://i.stack.imgur.com/9AIX7.png)](https://i.stack.imgur.com/9AIX7.png)

Formula in `C2`:

```
=BYROW(A2:B5,LAMBDA(X,IFERROR(VLOOKUP(INDEX(X,2),E$2:M$4,CHOOSE(--MID(INDEX(X,1),5,99),2,4,5,8),0),"")))

```

---

Btw, kudos for well written questions!
Kind of dirty but works perfect:

[![enter image description here](https://i.stack.imgur.com/G7oVd.png)](https://i.stack.imgur.com/G7oVd.png)

Aboe your Table2, add a transposed row with those Use 1, Use 2 ...Use N in the position where you want the value to be extracted. Then combine VLOOKUP with MATCH.

My formula in column D is:

```
=VLOOKUP(B3;$A$14:$I$16;MATCH(A3;$A$12:$I$12;0);FALSE)

```

You cam trap this into an IF.ERROR or IF for the `Unknown` option.

The advantage of this approach is that you can add/switch more `Use N`easily just changing the target ranges.