Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get the value two rows above the XLOOKUP results

  | A  |        B        | C |    D    |
--|----|-----------------|---|---------|---
1 |    |Brand A          |   | Criteria|
2 |    |Production Line1 |   |   P2    |
3 | P1 |      500        |   |         |
4 | P1 |      100        |   | Result  |
5 | P1 |      800        |   | Brand B |
6 |    |                 |   |         |
7 |    |Brand B          |   |         | 
8 |    |Production Line1 |   |         |
9 | P2 |      700        |   |         |
10| P2 |      300        |   |         |
11|    |                 |   |         |
12|    |Brand C          |   |         |
13|    |Production Line2 |   |         |
14| P3 |      200        |   |         |
15| P3 |      500        |   |         |
16| P3 |      800        |   |         |
17| P3 |      300        |   |         |
18|    |                 |   |         |

In Cell D5 I want to extract the brand based on the criteria in Cell D2.
So far I have been able to implement this XLOOKUP:

=XLOOKUP(D2,A1:A18,B1:B18,NA(),0)

The result of this XLOOKUP is 700.
However, I need to modify the XLOOKUP so it always takes the value in the cell two rows above the results.
In the example Cell B7 (Brand B)

Do you have any idea how to do this?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

=OFFSET(XLOOKUP(D2,A1:A18,B1:B18,NA(),0),-2,0)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading