tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,832
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have two tables as per below.

Table1

Field1Field2DateResult
1a01/01/2010
2b02/01/2010
3c03/01/2010
4d04/01/2010
5e05/01/2010
1a01/01/2010
2b02/01/2010
3c03/01/2010
4d04/01/2010
5e05/01/2010

<tbody>
</tbody>



Table2

Field1Field2DateField To Return
1a02/01/2010 aa
2b03/01/2010 bb
3c04/01/2010 cc
4d05/01/2010 dd
5e06/01/2010 ee
1a02/01/2010 aa
2b03/01/2010 bb
3c04/01/2010 cc
4d05/01/2010 dd
5e06/01/2010 ee

<tbody>
</tbody>



I want to search for Field1 and Field2 in Table1 and find its corresponding row in Table2, then if the date in Table1 (or that row) is before the corresponding row in Table2, return its Field To Return value to the column labelled Result in Table1.

I have tried this formula:

Code:
=IF((A3=$I$3:$I$12)*(B3=$J$3:$J$12)*(C3<$K$3:$K$12),$L$3:$L$12,"BLANK")

When I enter "normally" I get this:

Code:
aa
bb
cc
dd
ee
aa
bb
cc
dd
ee

but if I enter it as an array formula, I only get this:

Code:
aa
BLANK
BLANK
BLANK
BLANK
aa
BLANK
BLANK
BLANK
BLANK
BLANK

What I am trying to achieve is search for Field1 and Field2 from Table 1 and look at "the whole of Table2", as opposed to row by row.

Can this be achieved using formulae or VBA?

Thanks
 
Last edited:

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I'd use a helper column in both tables i.e.

- new column before field1 in both tables
- fill with formula down "= field1 & field2"

Then you can use a VLOOKUP, like:
Code:
=IF(VLOOKUP(A2,table1<table1>,3,0) < C2, VLOOKUP(A2<c2,vlookup(a2,<table1>,table1,4,0),"")
You'll need to adjust this formula to your sheet and ranges</c2,vlookup(a2,<table1></table1>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top