[Formula] Index/Match with embeeded If Criteria

TheMaven

New Member
Joined
Mar 3, 2016
Messages
14
So longer story short I think i'm about 75% there but need a little help with this formula. Basically I'm trying to cross check table 1 with table two to where if the vessel name appears in table 2 and the commencing date / completion date fill inside of the table 1's commencing/completing date it returns the voyage number.

Row 6 seems to not want to return 19255 given teh rnage is inside is my first problem. On row 8 it doesnt appear to be matching the vessel name. Any assistance with be greatly appreciated.

bxeR0t5.jpg
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

TheMaven

New Member
Joined
Mar 3, 2016
Messages
14
I am using an array function, just when you click inside the formula , the bars disappear which makes it harder to see what I"m trying to do.
 

TheMaven

New Member
Joined
Mar 3, 2016
Messages
14
Code:
[SIZE=2][TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD][CENTER]D[/CENTER]
[/TD]
[TD][CENTER]E[/CENTER]
[/TD]
[TD][CENTER]G[/CENTER]
[/TD]
[TD][CENTER]P[/CENTER]
[/TD]
[TD][CENTER]Q[/CENTER]
[/TD]
[TD][CENTER]S[/CENTER]
[/TD]
[TD][CENTER]T[/CENTER]
[/TD]
[TD][CENTER]U[/CENTER]
[/TD]
[TD][CENTER]X[/CENTER]
[/TD]
[TD][CENTER]Y[/CENTER]
[/TD]
[TD][CENTER]Z[/CENTER]
[/TD]
[TD][CENTER]AA[/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]1[/CENTER]
[/TD]
[TD][CENTER]Table 1[/CENTER]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][CENTER]Table2[/CENTER]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][CENTER]2[/CENTER]
[/TD]
[TD="bgcolor: #95B3D7"]  Vessel[/TD]
[TD="bgcolor: #95B3D7"]  Voyage[/TD]
[TD="bgcolor: #95B3D7"]  Function at Port[/TD]
[TD="bgcolor: #95B3D7"]  Voyage Commencing Date[/TD]
[TD="bgcolor: #95B3D7"]  Voyage Completing Date[/TD]
[TD="bgcolor: #95B3D7"]  Cross Check[/TD]
[TD][/TD]
[TD][/TD]
[TD="bgcolor: #E6B8B7"]  Vessel Name[/TD]
[TD="bgcolor: #E6B8B7"]  Voy No[/TD]
[TD="bgcolor: #E6B8B7"]  Voyage Commencing Date[/TD]
[TD="bgcolor: #E6B8B7"]  Completion Date[/TD]
[/TR]
[TR]
[TD][CENTER]3[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"]  ADELE MARINA RIZZO[/TD]
[TD="bgcolor: #E6B8B7"]  1[/TD]
[TD="bgcolor: #E6B8B7"]  DISCHARGING[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]5/1/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]5/31/2010[/B][/CENTER]
[/TD]
[TD][RIGHT]{=INDEX($Y$3:$Y$332,MATCH(1,IF(($D$3:$D$12454=$X$3:$X$332)*(P3<=$Z$3:$Z$332)*(Q3>$AA$3:$AA$332),0)))}[/RIGHT]
[/TD]
[TD][/TD]
[TD][/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  19422[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]5/15/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]5/16/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]4[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"]  ADELE MARINA RIZZO[/TD]
[TD="bgcolor: #E6B8B7"]  1[/TD]
[TD="bgcolor: #E6B8B7"]  DISCHARGING[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]6/1/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]6/30/2010[/B][/CENTER]
[/TD]
[TD][RIGHT]{=INDEX($Y$3:$Y$332,MATCH(1,IF(($D$3:$D$12454=$X$3:$X$332)*(P4<=$Z$3:$Z$332)*(Q4>$AA$3:$AA$332),0)))}[/RIGHT]
[/TD]
[TD][/TD]
[TD][/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  19445[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]6/10/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]6/11/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]5[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"]  ADELE MARINA RIZZO[/TD]
[TD="bgcolor: #E6B8B7"]  1[/TD]
[TD="bgcolor: #E6B8B7"]  LOADING[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]8/15/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]8/30/2010[/B][/CENTER]
[/TD]
[TD][RIGHT][COLOR=#FF0000]{=INDEX($Y$3:$Y$332,MATCH(1,IF(($D$3:$D$12454=$X$3:$X$332)*(P5<=$Z$3:$Z$332)*(Q5>$AA$3:$AA$332),0)))}[/COLOR][/RIGHT]
[/TD]
[TD][/TD]
[TD][/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  19221[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]7/10/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]7/11/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]6[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"]  ADELE MARINA RIZZO[/TD]
[TD="bgcolor: #E6B8B7"]  1[/TD]
[TD="bgcolor: #E6B8B7"]  DISCHARGING[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]9/1/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]9/21/2010[/B][/CENTER]
[/TD]
[TD][CENTER]{=INDEX($Y$3:$Y$332,MATCH(1,IF(($D$3:$D$12454=$X$3:$X$332)*(P6<=$Z$3:$Z$332)*(Q6>$AA$3:$AA$332),0)))}[/CENTER]
[/TD]
[TD][/TD]
[TD][/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  18755[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]8/25/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]8/26/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]7[/CENTER]
[/TD]
[TD]  EAGLE MIRI[/TD]
[TD]  1[/TD]
[TD]  LOADING[/TD]
[TD][CENTER]8/24/2010[/CENTER]
[/TD]
[TD][CENTER]9/16/2010[/CENTER]
[/TD]
[TD][CENTER]=INDEX($Y$3:$Y$332,MATCH(1,IF(($D$3:$D$12454=$X$3:$X$332)*(P7<=$Z$3:$Z$332)*(Q7>$AA$3:$AA$332),0)))[/CENTER]
[/TD]
[TD][/TD]
[TD][/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  19255[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]9/10/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]9/11/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]8[/CENTER]
[/TD]
[TD]  EAGLE MIRI[/TD]
[TD]  1[/TD]
[TD]  DISCHARGING[/TD]
[TD][CENTER]8/24/2010[/CENTER]
[/TD]
[TD][CENTER]9/16/2010[/CENTER]
[/TD]
[TD][RIGHT][COLOR=#FF0000]{=INDEX($Y$3:$Y$332,MATCH(1,IF(($D$3:$D$12454=$X$3:$X$332)*(P8<=$Z$3:$Z$332)*(Q8>$AA$3:$AA$332),0)))}[/COLOR][/RIGHT]
[/TD]
[TD][/TD]
[TD][/TD]
[TD]  ADVANTAGE ANTHEM[/TD]
[TD]  19695[/TD]
[TD][CENTER]11/12/2016[/CENTER]
[/TD]
[TD][CENTER]11/14/2016[/CENTER]
[/TD]
[/TR]
</tbody>[/TABLE]
[/SIZE]
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201

ADVERTISEMENT

You appear to know how to post.

Would you re-post Table 1 and Table 2 separately, without formulas, but with the correct desired values?
 
Last edited:

TheMaven

New Member
Joined
Mar 3, 2016
Messages
14
The goal is for table 1 Cross Check(Column S) to return the Voy No from table 2(column Y) if the vessel name matches and the voyage commencing/completion date falls between table 1's dates. Sorry about the posting, learning as I go, let me know if you have any more questions.

Code:
[SIZE=2][TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD][CENTER]D[/CENTER]
[/TD]
[TD][CENTER]E[/CENTER]
[/TD]
[TD][CENTER]G[/CENTER]
[/TD]
[TD][CENTER]P[/CENTER]
[/TD]
[TD][CENTER]Q[/CENTER]
[/TD]
[TD][CENTER]S[/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]1[/CENTER]
[/TD]
[TD][CENTER]Table 1[/CENTER]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][CENTER]2[/CENTER]
[/TD]
[TD="bgcolor: #95B3D7"]  Vessel[/TD]
[TD="bgcolor: #95B3D7"]  Voyage[/TD]
[TD="bgcolor: #95B3D7"]  Function at Port[/TD]
[TD="bgcolor: #95B3D7"]  Voyage Commencing Date[/TD]
[TD="bgcolor: #95B3D7"]  Voyage Completing Date[/TD]
[TD="bgcolor: #95B3D7"]  Cross Check[/TD]
[/TR]
[TR]
[TD][CENTER]3[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"]  ADELE MARINA RIZZO[/TD]
[TD="bgcolor: #E6B8B7"]  1[/TD]
[TD="bgcolor: #E6B8B7"]  DISCHARGING[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]5/1/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]5/31/2010[/B][/CENTER]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][CENTER]4[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"]  ADELE MARINA RIZZO[/TD]
[TD="bgcolor: #E6B8B7"]  1[/TD]
[TD="bgcolor: #E6B8B7"]  DISCHARGING[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]6/1/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]6/30/2010[/B][/CENTER]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][CENTER]5[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"]  ADELE MARINA RIZZO[/TD]
[TD="bgcolor: #E6B8B7"]  1[/TD]
[TD="bgcolor: #E6B8B7"]  LOADING[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]8/15/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]8/30/2010[/B][/CENTER]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][CENTER]6[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"]  ADELE MARINA RIZZO[/TD]
[TD="bgcolor: #E6B8B7"]  1[/TD]
[TD="bgcolor: #E6B8B7"]  DISCHARGING[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]9/1/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]9/21/2010[/B][/CENTER]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][CENTER]7[/CENTER]
[/TD]
[TD]  EAGLE MIRI[/TD]
[TD]  1[/TD]
[TD]  LOADING[/TD]
[TD][CENTER]8/24/2010[/CENTER]
[/TD]
[TD][CENTER]9/16/2010[/CENTER]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/SIZE]

Code:
[SIZE=2][TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD][CENTER]X[/CENTER]
[/TD]
[TD][CENTER]Y[/CENTER]
[/TD]
[TD][CENTER]Z[/CENTER]
[/TD]
[TD][CENTER]AA[/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]1[/CENTER]
[/TD]
[TD][CENTER]Table2[/CENTER]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][CENTER]2[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"]  Vessel Name[/TD]
[TD="bgcolor: #E6B8B7"]  Voy No[/TD]
[TD="bgcolor: #E6B8B7"]  Voyage Commencing Date[/TD]
[TD="bgcolor: #E6B8B7"]  Completion Date[/TD]
[/TR]
[TR]
[TD][CENTER]3[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  19422[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]5/15/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]5/16/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]4[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  19445[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]6/10/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]6/11/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]5[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  19221[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]7/10/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]7/11/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]6[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  18755[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]8/25/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]8/26/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]7[/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][B]  ADELE MARINA RIZZO[/B][/TD]
[TD="bgcolor: #E6B8B7"][B]  19255[/B][/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]9/10/2010[/B][/CENTER]
[/TD]
[TD="bgcolor: #E6B8B7"][CENTER][B]9/11/2010[/B][/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]8[/CENTER]
[/TD]
[TD]  ADVANTAGE ANTHEM[/TD]
[TD]  19695[/TD]
[TD][CENTER]11/12/2016[/CENTER]
[/TD]
[TD][CENTER]11/14/2016[/CENTER]
[/TD]
[/TR]
[TR]
[TD][CENTER]9[/CENTER]
[/TD]
[TD]  ALABRA[/TD]
[TD]  19199[/TD]
[TD][CENTER]10/26/2015[/CENTER]
[/TD]
[TD][CENTER]10/28/2015[/CENTER]
[/TD]
[/TR]
</tbody>[/TABLE]
[/SIZE]
 

TheMaven

New Member
Joined
Mar 3, 2016
Messages
14

ADVERTISEMENT

I might have figured it out, can someone take a look and see if im' missing anything

{=INDEX($Y$3:$Y$331,MATCH(1,($Z$3:$Z$331>P15)*($AA$3:$AA$331<Q15)*($X$3:$X$331=D15),0))}
 

TheMaven

New Member
Joined
Mar 3, 2016
Messages
14
EDIT:...not sure why I cant edit a post

{=INDEX($Y$3:$Y$331,MATCH(1,($Z$3:$Z$331>P15)*($AA$3:$AA$331<q15)
*($X$3:$X$331=D15),0))}</q15)
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
With no distractors...

Row\Col
D​
E​
P​
Q​
R​
S​
X​
Y​
Z​
AA​
2​
Vessel Voyage Function at PortXxYy Cross Check Vessel Name Voy NoXxYy
3​
ADELE MARINA RIZZO 1 DISCHARGING
5/1/2010
5/31/2010
ADELE MARINA RIZZO 19422
5/15/2010
5/16/2010
4​
ADELE MARINA RIZZO 1 DISCHARGING
6/1/2010
6/30/2010
ADELE MARINA RIZZO 19445
6/10/2010
6/11/2010
5​
ADELE MARINA RIZZO 1 LOADING
8/15/2010
8/30/2010
ADELE MARINA RIZZO 19221
7/10/2010
7/11/2010
6​
ADELE MARINA RIZZO 1 DISCHARGING
9/1/2010
9/21/2010
ADELE MARINA RIZZO 18755
8/25/2010
8/26/2010
7​
EAGLE MIRI 1 LOADING
8/24/2010
9/16/2010
ADELE MARINA RIZZO 19255
9/10/2010
9/11/2010
8​
ADVANTAGE ANTHEM 19695
11/12/2016
11/14/2016
9​
ALABRA 19199
10/26/2015
10/28/2015

<tbody>
</tbody>


What is the first value that must appear in S3 and how that obtains when you would do it manually?
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,123,400
Messages
5,601,467
Members
414,452
Latest member
Dannysamworth

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
Top