You should not need lookup tables.

Make several helper columns and copy the formulas down in each.

Helper column 1: Use the link in my second post to determine how many dashes there are in the string. Use and if statement to determine if you are dealing with a short string (3 dashes) or a long string (4 dashes).

Helper columns 2-5: Use the find command to determine the positions of the 2nd, 3rd and 4th dashes. Note that for short strings, the position of the 4th dash does not exist so it will be an error so use IFERROR.

Helper column 6-8: use an if statement against helper column 1 to determine what part of the string is Var1, what part is Var2, etc.

Apply a pivot table to the whole thing.

Or you can try something entirely different.

Insert 4 columns between Column A and Column B. Apply text-to-columns to column A. this will give you 4 or 5 columns of data. You can count up the number of columns that have data (COUNTA) to determine if you are dealing with a long string or a short string. Use an if statement to determine which columns are Var1, Var2, etc.

Put header titles over each column of data. Apply a pivot table.

That's about as explicit as I can get without actually doing the problem for you.