I'm using a vlookup function for one of my excel tools at work. I built it to find a relevant salary value in a salary table based upon references from within the worksheet. The salary table is composed of Grades, which are in the left hand column, and Steps which are in the top row. An employee's salary is determined by which Step they've achieved within their specific Grade.
The function works like this: Suppose that an employee's basic information is in row 10. Their Grade is in Cell C10 and their Step is in cell D10 (both numeric). The salary table is in Sheet2, A1:G16. The function for this employee looks like this:
=vlookup(C10, "Sheet2"!A1:G16, (D10+1), False)
This function works properly, referencing the Grade level and Step value (which I had to add 1 to in order to make coincide with the column reference number). The problem is that when I try to sort the data, which is a useful functionality of the tool, the references within the function don't sort properly. The reference value (C10) sorts correctly, but the column reference number (D10) remains static. For example, if I resort the data and this same employee ends up in column 4, the new function would be:
=vlookup(C4, "Sheet2"!A1:G16, (D10+1), False)
Any suggestions?
The function works like this: Suppose that an employee's basic information is in row 10. Their Grade is in Cell C10 and their Step is in cell D10 (both numeric). The salary table is in Sheet2, A1:G16. The function for this employee looks like this:
=vlookup(C10, "Sheet2"!A1:G16, (D10+1), False)
This function works properly, referencing the Grade level and Step value (which I had to add 1 to in order to make coincide with the column reference number). The problem is that when I try to sort the data, which is a useful functionality of the tool, the references within the function don't sort properly. The reference value (C10) sorts correctly, but the column reference number (D10) remains static. For example, if I resort the data and this same employee ends up in column 4, the new function would be:
=vlookup(C4, "Sheet2"!A1:G16, (D10+1), False)
Any suggestions?