Question: Below is a code I made in Python for our lab activity which makes a triangle.

```
side = input("Input side: ")

def triangle(x):
    print ((x - 1)*" "),"*"
    asterisk = "*"
    space = side
    for i in range(x):
            asterisk = "**" + asterisk
            space = (space-1) * " "
            print space,asterisk

triangle(side)

```

The output should be this:

```
  *
 ***
*****

```

I got the number of asterisks on each row correctly, but I cannot figure out how to make the necessary amount of spaces to make it look like a triangle. Using the above code, which I think *might* be the solution, always produces an error at line 9. Any help I appreciated. (I'm new here so if I violated some rules please let me know.) Thanks and good day!

Answer: 
Try this in C17 then fill right and down.

```
=INDEX($A$3:$Z$12, MATCH($A17, $A$3:$A$12, 0), AGGREGATE(15, 7, (COLUMN(1:1)+MATCH($B17, $1:$1, 0)-2)/($2:$2=C$16), 1))

```

[![enter image description here](https://i.stack.imgur.com/uRZ3U.png)](https://i.stack.imgur.com/uRZ3U.png)
For cell C17: `IF(B17="USER_A",VLookup(A17,A3:C12,2,0),VLookup(A17,A3:E12,4,0))`

For cell D17: `IF(B17="USER_A",VLookup(A17,A3:C12,3,0),VLookup(A17,A3:E12,5,0))`

In this formula replace `A3:C12` and `A3:E12` with your appropriate table range, then drag these down.