Filtering for exact order of words

Girol

New Member
Joined
Oct 7, 2017
Messages
1
Hello,

I want to filter below column for PASIR GUDANG - SINGAPORE exact order.


DURBAN
MUNDRA
KANDLA
PASIR GUDANG
PASIR GUDANG
PASIR GUDANG
SINGAPORE
KUALA TANJUNG
PORT LOUIS
PASIR GUDANG
MAPUTO
SINGAPORE
BELAWAN
BELAWAN
BELAWAN
PASIR GUDANG
SINGAPORE
KUALA TANJUNG
DURBAN
CAPE TOWN
SANTOS
PARANAGUA
PARANAGUA
SANTOS

<colgroup><col></colgroup><tbody>
</tbody>

If there is another city between, this should not be in the list.
PASIR GUDANG
MAPUTO
SINGAPORE


<tbody>
</tbody>

I hope you can help me with this.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Welcome to the board.

A​
B​
C​
1​
City
Filter
2​
DURBAN
0​
B2: =(A2="PASIR GUDANG")*(A3="SINGAPORE") + (A2="SINGAPORE")*(A1="PASIR GUDANG")
3​
MUNDRA
0​
4​
KANDLA
0​
5​
PASIR GUDANG
0​
6​
PASIR GUDANG
0​
7​
PASIR GUDANG
1​
8​
SINGAPORE
1​
9​
KUALA TANJUNG
0​
10​
PORT LOUIS
0​
11​
PASIR GUDANG
0​
12​
MAPUTO
0​
13​
SINGAPORE
0​
14​
BELAWAN
0​
15​
BELAWAN
0​
16​
BELAWAN
0​
17​
PASIR GUDANG
1​
18​
SINGAPORE
1​
19​
KUALA TANJUNG
0​
20​
DURBAN
0​
21​
CAPE TOWN
0​
22​
SANTOS
0​
23​
PARANAGUA
0​
24​
PARANAGUA
0​
25​
SANTOS
0​
 
Upvote 0
You could also use Advanced Filter if you have a heading above the list.
I have the required order in H1
G1 is blank and G2 holds the formula shown


Book1
ABCDEFGH
1LocationPASIR GUDANG-SINGAPORE
2DURBANFALSE
3MUNDRA
4KANDLA
5PASIR GUDANG
6PASIR GUDANG
7PASIR GUDANG
8SINGAPORE
9KUALA TANJUNG
10PORT LOUIS
11PASIR GUDANG
12MAPUTO
13SINGAPORE
14BELAWAN
15BELAWAN
16BELAWAN
17PASIR GUDANG
18SINGAPORE
19KUALA TANJUNG
20DURBAN
21CAPE TOWN
22SANTOS
23PARANAGUA
24PARANAGUA
25SANTOS
Adv Fltr
Cell Formulas
RangeFormula
G2=OR(A1&"-"&A2=H$1,A2&"-"&A3=H$1)



Select A1:A?? (or your whole data range) and use Advanced (in the 'Sort & Filter' section of the Data ribbon tab)
Click OK if Excel says it can't determine the list.
Filter the list in place, Criteria range: G1:G2, OK

Result:


Book1
A
1Location
7PASIR GUDANG
8SINGAPORE
17PASIR GUDANG
18SINGAPORE
Adv Fltr
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,447
Members
448,898
Latest member
drewmorgan128

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