Reverse lookup of numbers is easier than that of texts.

Reverse Lookup Numbers

For example, how do you look up the appointment date and time for a patient in the below data?

The below video explains the steps

Note:

⭐ It is possible to create an array of Date and Time because Excel stores Date as integers and Time as a fraction of 24 hours

The issue becomes more complex when reverse-looking up text.

Reverse Lookup Text

For example, how do you return the Doctor & Session for a patient below?

See step by step video below

=INDEX(
Doctors&" - "&Sessions,
   MAX(IF(Clients=F5,ROW(Clients)-ROW(Sessions),"")),
      MAX(IF(Clients=F5,COLUMN(Clients)-COLUMN(Doctors),""))
   )

The trick here is using the MAX and IF functions to return both the Row and Column numbers

Also, when returning the row/column number, remember to adjust the count to start after the headers.

Using PowerQuery to Reverse Lookup

Here are the 5 steps

Step 1:
Get data from the Criteria table and load it as a connection only
Then get data from the Appointment table

Step 2:
Select the doctor’s column from the appointment table and unpivot other columns. Then filter it using any patient name.

Step 3:
Convert the criteria table to a single value by drilling down on the value

Step 4:
Replace the temporary filter with the criteria.

Step 5
Modify the filtered appointment table and load it out to an existing worksheet.

Using PowerQuery LeftOuter Join to Reverse Lookup

Here is an alternative using Left-Outer Join.

Step 1:
Get data from the Criteria table and load it as a connection only
Then get data from the Appointment table

Step 2:
Select the doctor’s column from the appointment table and unpivot other columns. Then filter it using any patient name.

Step 3:

Merge the Criteria with the appointment table where the criteria equal to the Patients

Step 4

Expand the merged query, remove the unnecessary columns and load it as a table

DOWNLOAD WORKSHEET

Read more

Linkedin Article

Do you want to excel in Excel?

Or

Seeking Microsoft Certification?

Every Week Receive Resources To Get you Closer to Your Goal!

No Huff! No Fluff! No Spam!

You are on your way to Excelling in Excel and Becoming Microsoft Certified!

Share This

Spread the Good News!

Do me favour, please? Share this with your friends!

Thanks For Commenting!

Awesome for you to comment! Please share the post with your friends.