# Two-Way Lookup, NOT Using Matrix

#### tjthom

##### New Member
Hello!

I am trying to use a formula to first Search vertically within a column for "VALUE A", then search within the row of "VALUE A" for "VALUE B", then output "VALUE C" from row 1 of the column that "VALUE B" is located within. Here is a photo of what I would like:

I have found something similar to this, but it requires that the lookup value be the top row of the reference/array. In my situation, the output will always be above the second lookup value (value B). Here is an article that describes something similar, but it is NOT WHAT I WANT: How to Use INDEX MATCH MATCH

Does anyone know of a formula that I could assemble that would search above the second criteria as shown above?

ADDITIONALLY... I would like to create a second formula that will search for the last "value B" in a row and return the resulting time of that as well. Essentially, the first formula I need is described in the picture above, but I would like to create a second, separate formula that gives me the latest time. Value B represents an assigned task someone will be doing, and I want to output the start and end time of that task, for that person.

### Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

#### Eric W

##### MrExcel MVP
Here's one way to do it.

Excel 2010
ABCDEFGHIJKLMNOP
1Value A7:007:157:458:008:158:308:459:009:159:30
3
4Value B
54.03
6
7First Time
88:45:00 AM
9
10Last Time
119:30:00 AM
12

</tbody>
Sheet1

Worksheet Formulas
CellFormula
A8=INDEX(G1:AA1,MATCH(A5,INDEX(G1:AA20,MATCH(A2,C:C,0),0),0))

</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
A11{=INDEX(G1:AA1,MATCH(2,1/(INDEX(G1:AA20,MATCH(A2,C:C,0),0)=A5)))}

</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

You'll want to put these in your preferred locations, and you'll need to adjust the ranges in them to match your sheet. The "Last Time" formula is an array formula, so confirm it with Control-Shift-Enter. Let me know how they work for you.

Replies
2
Views
262
Replies
10
Views
81
Replies
9
Views
151
Replies
5
Views
68
Replies
8
Views
75

1,109,411
Messages
5,528,617
Members
409,828
Latest member
99DodgeRam

### This Week's Hot Topics

• Change military grades into rank
Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
• VBA COUNTIF SOLUTION
Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
• INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...