I am looking to do the following:
If A2 in table1 matches A2 in table2, and if number in B2 from table1 is less than B2 in table2, then say "high", If A2 in table1 matches A2 in table2, and the number in B2 from table1 is greater than B2 in table2 and less than C2 in table2, then give cell value of 3. If the number in B2 from table1 then is larger than C2, then add another 3 so the cell says 6. Keep doing this until the first statement of A2 in table1 and A2 in table2 is not true, and when not true, begin the cycle over - so If A2 in table1 matches A2 in table2, and if number in B2 from table1 is greater than B2 in table2 and less than C2 in table2, then give cell value of 3. If the number in B2 from table1 then is large than C2, then add another 3 so the cell says 6, etc.
My original code basically wrote the same code to cover the number of columns I had (78 in total). It worked but this was too much and crashed excel. It was copy and paste of code, changing column look-ups and then giving the cell the assigned value (ie "3"). I'm looking to do the above but with a shorter code string. Ideas? I feel I need it to add 3 based on if a statement is true (or not). I can start the statement, but I can't figure out the increment part to have it change to 6, then 9, etc and then start back at 3 when the A2 cells aren't matching anymore.
Attached a spreadsheet with data and layout i'm using.
The original, very long statement i used: (could get the job done, but couldn't compute past the first 5 rows without buggering up)
=IF(((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,1,FALSE))='LAS data'!A2)*AND('LAS data'!B2<(VLOOKUP(A2,'3mTOPS'!A$2:BD$434,2,FALSE))),"high",IF(((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,1,FALSE))='LAS data'!A2)*AND('LAS data'!B2>=(VLOOKUP(A2,'3mTOPS'!A$2:BD$434,2,FALSE)))*AND('LAS data'!B2<(VLOOKUP(A2,'3mTOPS'!A$2:N$434,3,FALSE))),"3",IF(((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,1,FALSE))='LAS data'!A2)*AND((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,3,FALSE))=""),"3",IF(((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,1,FALSE))='LAS data'!A2)*AND('LAS data'!B2>=(VLOOKUP(A2,'3mTOPS'!A$2:BD$434,3,FALSE)))*AND('LAS data'!B2<(VLOOKUP(A2,'3mTOPS'!A$2:N$434,4,FALSE))),"6",IF(((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,1,FALSE))='LAS data'!A2)*AND((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,4,FALSE))=""),"6",IF(((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,1,FALSE))='LAS data'!A2)*AND('LAS data'!B2>=(VLOOKUP(A2,'3mTOPS'!A$2:BD$434,4,FALSE)))*AND('LAS data'!B2<(VLOOKUP(A2,'3mTOPS'!A$2:N$434,5,FALSE))),"9",IF(((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,1,FALSE))='LAS data'!A2)*AND((VLOOKUP(A2,'3mTOPS'!A$2:BD$434,5,FALSE))=""),"9",...... etc until i got to ,"78","blank")))))))))))))))))))))))))))))))))))))))))))))))))))))
Bookmarks