In excel, I am trying to compare two values to another two values that are in different columns. If they all match then it should copy the value on the adjacent column (In this case it's the third one), but I'm not finding any articles or websites explaining how to do it. You can find the formula that I am using below:
=IFERROR(VLOOKUP(AND(MATCH(A$2:A$22=F$1;A$2:B$22;0);MATCH(B$2:B$22=E2;A$2:B$22;0));A$2:B$22;3);"error")

Note: The values in the first and second columns may differ (example: instead of the first floor I can have the ground floor). I need a formula that can be dynamic depending on the values that are inserted in those cells/columns/rows.
Can any of you help me?
