Formula to Extract Unique Value base Multiple Criteria

Lukma

Active Member
Joined
Feb 12, 2020
Messages
259
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi Friend

I need help with this formula i have a range of Data containing name of vessel in Column i 5 and Voyage on H 5 and month in G 5 and i have created Month in B 3 to search for each month i also list all vessel fix in B 5
my issue now is that i have entered my formula D 5 to extract using Ctr Shift Enter but still now giving right extraction and also i need a formula that do not require Ctr Shift Enter if there is Option which will not allow my work to get slow to open

Please can anyone help with formula that can run faster to extract the voyage based on criteria appreciate your assistance

Book2
BCDEFGHI
301-Jan-21
4Supply Vessel'sP&D VSLVoayge Mus-NoMonthMus-NoSupply Vessel
5ADNOC-1010Half370501-Jan-21Mus-3705ADNOC-1010
6ADNOC-1010Full371301-Jan-21Mus-3706ADNOC-224
7ADNOC-1010Half371301-Jan-213666-OASL SWIFT
8ADNOC-1010Full371301-Jan-21Mus-3707Z-POWER
9ADNOC-1010Half371301-Jan-21Mus-3708SMIT LUZON
10ADNOC-1010Half371301-Jan-21Mus-3709SMIT LUMUT
11ADNOC-1010371301-Jan-21Mus-3710B-LIBERTY-313
12ADNOC-1010371301-Jan-21Mus-3711ADNOC-1011
13ADNOC-1010371301-Jan-21Mus-3712ADNOC-812
14ADNOC-1010371301-Jan-21Mus-3713ADNOC-1010
15ADNOC-1010401-Jan-21Mus-001LCT-TARFFAH
16ADNOC-1011701-Jan-21Mus-002ADNOC-850
17ADNOC-1011701-Jan-21Mus-003ADNOC-510
18ADNOC-1011701-Jan-21Mus-004ADNOC-1010
19ADNOC-1011701-Jan-21Mus-005MARCAP-2
20ADNOC-1011701-Jan-21Mus-006QMS DELTA
21ADNOC-1011701-Jan-21Mus-007ADNOC-1011
22ADNOC-10111601-Jan-21Mus-008QMS NEPTUNE
23ADNOC-10111601-Jan-21Mus-009ADNOC-221
24ADNOC-10111601-Jan-21Mus-010SEACOR ALPS
25ADNOC-10111601-Jan-21Mus-011ADNOC-229
26ADNOC-10111601-Jan-21Mus-012LCT-MARWAH-1
27ADNOC-221 01-Jan-21Mus-013Z-OCEAN
28ADNOC-221 01-Jan-21Mus-014ADNOC-1010
29ADNOC-221 01-Jan-21Mus-015A-LIBERTY
30ADNOC-221 01-Jan-21Mus-016ADNOC-1011
31ADNOC-221 01-Jan-21Mus-017ADNOC-225
32ADNOC-221 01-Jan-21Mus-018A-CHLOE
33ADNOC-221 01-Jan-21Mus-019ADNOC-811
34ADNOC-221 01-Jan-21Mus-020SWISSCO RUBY
35ADNOC-221 01-Jan-21Mus-021ADNOC-512
36ADNOC-221 01-Jan-21Mus-022AMS-RUBY
37ADNOC-221 01-Jan-21Mus-023ADNOC-511
Sheet1
Cell Formulas
RangeFormula
D5:D33D5=IFERROR(INDEX($H$5:$H$37,MATCH(0,IF($B5=$I$5:$I$37,IF($B$3=$G$5:$G$37,COUNTIF($H$4:$H4,$H$5:$H$37), "")), 0)),"")
D34:D37D34=IFERROR(INDEX($DF$14:$DF$60401,MATCH(0,IF($X34=$DG$14:$DG$60401,IF($B$5=$DE$14:$DE$60401,COUNTIF($Z$13:$Z33,$DF$14:$DF$60401), "")), 0)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
With Power Query, create a parameter query and filter for the date you wish. Insert a row in your worksheet at A1 so that your lookup date is in A2.
The Mcode for the parameter is:

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}}),
    crit=Record.Field(#"Changed Type"{0},"Column1")
in
    crit
close and load this to a connection only.

Your code for then filtering the data is

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Month", type date}, {"Mus-No", type any}, {"Supply Vessel", type text}, {"Column1", type any}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Month] = Mnth)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Column1"}),
    #"Grouped Rows" = Table.Group(#"Removed Columns", {"Supply Vessel"}, {{"Data", each _, type table [Month=nullable date, #"Mus-No"=any, Supply Vessel=nullable text]}}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"Mus-No"}, {"Data.Mus-No"}),
    #"Sorted Rows" = Table.Sort(#"Expanded Data",{{"Supply Vessel", Order.Ascending}})
in
    #"Sorted Rows"
 
Upvote 0
Hi Try This ! But It need Ctrl+shift +enter

{=IFERROR(SUBSTITUTE(INDEX($H$5:$H$37,AGGREGATE(15,6,IF(($I$5:$I$37=B5)*($G$5:$G$37=$B$3),ROW($G$5:$G$37)-ROW($G$4)),COUNTIF($B$5:B5,B5))),"Mus-",""),"")}
 
Upvote 0
Solution
Hi alz / Alansidman

But ways work just perfect and my worksheet open much better i really appreciate both side been so helpful

Regards​

 
  • Like
Reactions: alz
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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