# Lookup text in one column, return date from same row in different column

#### dallen8028

##### New Member
Using Excel 2016.

In the GMH Table, I am attempting to Lookup "Gas Tank Fill" in Event column of the History Table to return the date from same row in the Out column of the History Table using a table that will advance the formula when the next row is added.

=LOOKUP("Gas Tank Fill",Table6185115[Event],Table6185115[Out])

This formula works but is limited to just one match. As you can see there are two such matches with different dates. How do I get it to place the different dates in the next row that match the same "text"? Please see tables below. Thank you in advance.
 History Times General Mileage Expenses Out In Total Time Used Driver Event Notes Start Miles Kilometers Stop Miles Kilometers Total Miles Kilometers Gallons Cost per Gallon Cost per Fill Service Costs Exchange USD 8/7/18 15:58 8/9/18 17:00 1:02 Sampuel, Jose Gas Tank Fill 103,600 103,805.0 205.0 35.00 Q 26.20 Q 917.00 Q 7.48 \$ 122.55 8/8/18 13:35 8/8/18 16:00 2:25 Adams, Lawrence Oil & Filter Change 103,805 103,814.0 9.0 Q 26.20 Q - Q 523.00 Q 7.48 \$ 69.92 8/14/18 12:30 8/14/19 16:00 3:30 Yantuche, Angel Maintenance Replace 2 Back Tires 103,814 103,835.0 21.0 Q 26.20 Q - Q 1,899.00 Q 7.48 \$ 253.86 8/30/18 9:00 8/30/19 11:30 2:30 Sampuel, Jose Delivery Service 103,835 103,848.0 13.0 Q 26.20 Q - Q 7.55 \$ - 2/27/19 0:00 2/27/19 0:00 0:00 Calca, Flori Insurance 103,848 103,848.0 Q 26.20 Q - Q 3,330.91 Q 7.71 \$ 432.00 8/31/18 11:00 8/31/18 12:00 1:00 Sampuel, Jose Gas Tank Fill 103,848 103,852.0 4.0 22.82 Q 27.39 Q 624.99 2/27/19 0:00 8/30/19 11:30 10:27 103,600 103,852.0 252.0 57.82 Q 26.40 Q 1,541.99 Q 5,752.91 \$ 878.33 Gas Mileage History Date Tank Filled Miles Kilometers MPG KGP 8/7/2018 103600 8/7/2018 103852 8/7/2018 8/7/2018 8/7/2018 252

<tbody>
</tbody>

### Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Re: Lookup text in one culomn, return date from same row in different column

Is this what you want (not sure how you would do this with tables)?

in Q5
=IFERROR(INDEX(\$A\$5:\$A\$1000,AGGREGATE(15,6,ROW(\$A\$5:\$A\$1000)/((\$E\$5:\$E\$1000="Gas Tank Fill")),ROWS(A\$5:A5))-(5-1),1),"")
and copy down the column for as many rows as you expect in column A

format column Q as per column A

If first data row changes (row 5) to another row change the red 5s in the formula above.

Last edited:
Re: Lookup text in one culomn, return date from same row in different column

Thank you for your response Special-K99. The last image I pasted didn't do it justice. I hope the this one helps you to more understand where the cells are.

Last edited by a moderator:
Re: Lookup text in one culomn, return date from same row in different column

Thank you for the information. Could you please delete my last entry, not the post, but the last entry? Thank you in advance.

Re: Lookup text in one culomn, return date from same row in different column

I cant do that only mods or possibly yourself - looks like its gone though.

Re: Lookup text in one culomn, return date from same row in different column

You cant attach files on this forum. There are tools on this forum for adding small spreadsheet images

Re: Lookup text in one culomn, return date from same row in different column

If something's not working on this forum you need to contact a moderator.

Re: Lookup text in one culomn, return date from same row in different column

thank you

Replies
11
Views
392
Replies
5
Views
214
Replies
6
Views
401
Replies
2
Views
233
Replies
8
Views
342

1,203,384
Messages
6,055,115
Members
444,763
Latest member
Jaapaap

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back