Priority for Index Match

Forty2

New Member
Joined
Sep 12, 2022
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi Folks,

I was wondering if there was a way to have priority into a multi-conditions Match.

Here is my issue below: I have 3 data columns : Port, Vessel and Time of Arrival.

PortVesselActual Arrival
BARCELONACruise Barcelona
02/09/2022 18:58​
BARCELONACruise Roma
04/09/2022 21:23​
BARCELONA
Cruise Barcelona
31/08/2022 17:31​

I want to match the Actual arrive with a criteria/target as below, where Port and Vessel can have have exact match, and Planned Arrival is not an exact match
PortVesselPlanned Arrival
BARCELONACruise Barcelona
04/09/2022 19:00​

Therefore, at least in my opinion, there are two steps for this process :
1) Port and Vessel need to match - I can use an array Index Match for that all good. With Example above, row 1 and 3 will be ok.
2) Based on this shortlist of rows, i want to have the closest time possible to match, using MIN/ABS formula. Here, 04/09 is closest to 02/09, so row 1 should be selected.

My question is - is there a way to do this shortlist first? As if I try to have all conditions together in a single Index/Match, it would not work, as the closest matching row is row 2 where column 1 and 2 do not work.


Let me know if it's clear and if you need more details. Thanks for the support!
 

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.
MrExcelPlayground11.xlsx
ABC
12PortVesselActual Arrival
13BARCELONACruise Barcelona9/2/2022 18:58
14BARCELONACruise Roma9/4/2022 21:23
15BARCELONACruise Barcelona8/31/2022 17:31
16
17BARCELONACruise Barcelona9/4/2022 19:00
18
19Closest Time9/2/2022 18:58
Sheet25
Cell Formulas
RangeFormula
C19C19=SUMPRODUCT(--(IF((A13:A15=A17)*(B13:B15=B17),ABS(C13:C15-C17),99999)=(MIN(IF((A13:A15=A17)*(B13:B15=B17),ABS(C13:C15-C17),99999)))),C13:C15)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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