Pick the next "Step" when matching two variables

%3CLINGO-SUB%20id%3D%22lingo-sub-2149566%22%20slang%3D%22en-US%22%3EPick%20the%20next%20%22Step%22%20when%20matching%20two%20variables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2149566%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20having%20issues%20with%20a%20formula%20that%20needs%20to%20validate%20two%20variables%20(pay%20group%20and%20pay%20grade)%20and%20then%20return%20the%20value%20(next%20pay%20grade)%20in%20the%20row.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20formula%20works%20perfectly%20when%20the%20variables%20are%20actually%20in%20the%20cell%2C%20but%20not%20when%20the%20variable%20is%20a%20result%20of%20another%20formula%20that%20returns%20a%20value.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFormula%3A%26nbsp%3B%3DINDEX(%24AG%243%3A%24BD%248%2CMATCH(W25%2C%24AF%243%3A%24AF%248%2C0)%2CMATCH(X25%2C%24AG%242%3A%24BD%242%2C0))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20INDEX%20is%20all%20the%20rows%2Fcolumns%20of%20data%20that%20have%20the%20pay%20grades%3C%2FP%3E%3CP%3EThe%20first%20MATCH%20is%20looking%20for%20the%20Pay%20Group%20the%20employee%20is%20in%20in%20the%20column%20to%20the%20left%20of%20the%20INDEX%3C%2FP%3E%3CP%3EThe%20second%20MATCH%20is%20looking%20for%20the%20current%20Pay%20Grade%20in%20the%20row%20above%20the%20INDEX%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20result%20is%20supposed%20to%20return%20the%20next%20Pay%20Grade.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EE.G.%26nbsp%3B%20Employee%20is%20in%20Pay%20Group%20%22Admin%22%20and%20is%20currently%20at%20Pay%20Grade%202%2C%20the%20next%20step%20would%20be%20Pay%20Grade%203.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20I%20said%20above%2C%20the%20test%20formula%20works%20perfectly%20on%20my%20mock%20up%20data%20and%20the%20Pay%20Grade%20is%20the%20actual%20number.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20put%20the%20formula%20in%20the%20actual%20data%20set%20tab%20and%20the%20Pay%20Grade%20is%20the%20result%2Fvalue%20of%20another%20INDEX%2FMATCH%20formula%20it%20won't%20work%20unless%20I%20overwrite%20the%20formula%20with%20the%20result%20-%20which%20defeats%20the%20purpose%20of%20setting%20up%20the%20workbook%20automation.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20considered%20an%20IF%2FTHEN%20but%20there%20are%206%20Pay%20Groups%20and%2026%20Pay%20Grades%2C%20some%20of%20which%20are%20just%20numbers%20and%20some%20of%20which%20are%20numbers%20with%20letter(s).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20thought%20about%20CHOOSE%20but%20can't%20figure%20out%20how%20to%20make%20that%20happen%20either%20%3CLI-EMOJI%20id%3D%22lia_disappointed-face%22%20title%3D%22%3Adisappointed_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eany%20insight%20on%20how%20to%20change%20the%20formula%20or%20create%20a%20CHOOSE%20formula%20would%20be%20appreciated!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecathy%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2149566%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2149656%22%20slang%3D%22en-US%22%3ERe%3A%20Pick%20the%20next%20%22Step%22%20when%20matching%20two%20variables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2149656%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F972384%22%20target%3D%22_blank%22%3E%40bema2001%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ein%20the%20infamous%20words%20of%20Emily%20Litella....Never%20Mind....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%2C%20kinda%20sad%20answering%20my%20own%20question%20not%205%20minutes%20after%20I%20posted%20it%20%3A).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20spent%20the%20better%20part%20of%202%20hours%20on%20it%20yesterday%2C%20beating%20my%20head%20on%20the%20desk%20when%20I%20couldn't%20get%20it%20to%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERight%20after%20I%20sent%20the%20question%20I%20had%20a%20light%20bulb%20moment%20and%20tried%20flipping%20the%20INDEX%20layout%20to%20have%20the%20Pay%20Group%20in%20the%20column%20headers%20and%20the%20current%20Pay%20Grade%20in%20the%20column%20to%20the%20left%20of%20the%20INDEX%20and%20the%20next%20step%20Pay%20Grades%20in%20columns%20rather%20than%20rows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20I'll%20be%20darned%20if%20the%20formula%20didn't%20work%20as%20expected...oy%20vey....%20sorry%20to%20have%20bothered%20you%20but%20if%20someone%20else%20stumbles%20across%20this%20and%20it%20helps%20you%20then%20YEAH!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I'm having issues with a formula that needs to validate two variables (pay group and pay grade) and then return the value (next pay grade) in the row.

 

The formula works perfectly when the variables are actually in the cell, but not when the variable is a result of another formula that returns a value.

 

Formula: =INDEX($AG$3:$BD$8,MATCH(W25,$AF$3:$AF$8,0),MATCH(X25,$AG$2:$BD$2,0))

 

The INDEX is all the rows/columns of data that have the pay grades

The first MATCH is looking for the Pay Group the employee is in in the column to the left of the INDEX

The second MATCH is looking for the current Pay Grade in the row above the INDEX

 

The result is supposed to return the next Pay Grade.

 

E.G.  Employee is in Pay Group "Admin" and is currently at Pay Grade 2, the next step would be Pay Grade 3.

 

As I said above, the test formula works perfectly on my mock up data and the Pay Grade is the actual number.

 

When I put the formula in the actual data set tab and the Pay Grade is the result/value of another INDEX/MATCH formula it won't work unless I overwrite the formula with the result - which defeats the purpose of setting up the workbook automation.

 

I considered an IF/THEN but there are 6 Pay Groups and 26 Pay Grades, some of which are just numbers and some of which are numbers with letter(s).

 

I also thought about CHOOSE but can't figure out how to make that happen either

 

any insight on how to change the formula or create a CHOOSE formula would be appreciated!

 

cathy

 

1 Reply

@bema2001 

in the infamous words of Emily Litella....Never Mind....

 

I know, kinda sad answering my own question not 5 minutes after I posted it :).

 

I spent the better part of 2 hours on it yesterday, beating my head on the desk when I couldn't get it to work.

 

Right after I sent the question I had a light bulb moment and tried flipping the INDEX layout to have the Pay Group in the column headers and the current Pay Grade in the column to the left of the INDEX and the next step Pay Grades in columns rather than rows.

 

and I'll be darned if the formula didn't work as expected...oy vey.... sorry to have bothered you but if someone else stumbles across this and it helps you then YEAH!