modified formula delete duplicated item

leap out

Active Member
Joined
Dec 4, 2020
Messages
271
Office Version
  1. 2016
  2. 2010
hello
I need amending this formula it should ignore duplicated items
VBA Code:
=OFFSET(Sheet1!$A$1,MATCH(G10,Sheet1!$A:$A,0)-1,1,COUNTIF(Sheet1!$A:$A,G10),1)
thanks in advance
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I'm not clear what you mean?

To return just the first occurrence: =INDEX(Sheet1!B:B,MATCH(G10,Sheet1!$A:$A,))
 
Upvote 0
this formula is existed in COL B linked with COL A if I select from COL A then show the items in COL B but the problem the items are repeated in COL B
this formula shows like this in COL B after select from COL A
IT-1000
IT1000
ITD-2000
ITD-2000
it should like this
IT-1000
ITD-2000
 
Upvote 0
Do you mean like this?

AB
1MyListUniques
2IT1000IT-1000
3ITD-2000ITD-2000
4ITD-2000IT3000
5IT-1000X-XXX
6ITD2000YYYYY
7IT3000Z-Z
8X-XXX 
9YYYYY 
10XXXX 
11ZZ 
12XXXX 
13Z-Z 
Sheet7
Cell Formulas
RangeFormula
B2:B13B2=IFERROR(INDEX(MyListHyphen,MATCH(0,MMULT(--(MyListHyphen=TRANSPOSE(B$1:B1)),ROW(INDIRECT("1:"&ROWS(B$1:B1)))^0),)),"")
Named Ranges
NameRefers ToCells
MyList=Sheet7!$A$2:$A$13B2:B13

where MyListHyphen: =IFERROR(INDEX(MyList,MATCH(SUBSTITUTE(MyList,"-",""),IF(ISNUMBER(FIND("-",MyList)),SUBSTITUTE(MyList,"-","")),)),MyList)
 
Upvote 0
actually your formula doesn't work correctly for me
Microsoft Excel (7).xlsx
AB
1MyListUniques
2IT1000IT1000
3ITD-2000 
4ITD-2000 
5IT-1000 
6ITD2000 
7IT3000 
8X-XXX 
SH
Cell Formulas
RangeFormula
B2:B8B2=IFERROR(INDEX(MyListHyphen,MATCH(0,MMULT(--(MyListHyphen=TRANSPOSE(B$1:B1)),ROW(INDIRECT("1:"&ROWS(B$1:B1)))^0),)),"")
Named Ranges
NameRefers ToCells
MyListHyphen=SH!$A$2:$A$7B2:B8
XR][/RANGE]
 
Upvote 0
actually your formula doesn't work correctly for me
Microsoft Excel (7).xlsx
AB
1MyListUniques
2IT1000IT1000
3ITD-2000 
4ITD-2000 
5IT-1000 
6ITD2000 
7IT3000 
8 
SH
Cell Formulas
RangeFormula
B2:B8B2=IFERROR(INDEX(MyListHyphen,MATCH(0,MMULT(--(MyListHyphen=TRANSPOSE(B$1:B1)),ROW(INDIRECT("1:"&ROWS(B$1:B1)))^0),)),"")
Named Ranges
NameRefers ToCells
MyListHyphen=SH!$A$2:$A$7B2:B8
 
Upvote 0
My formula uses two range names:

MyList: =SH!$A$2:$A$7

MyListHyphen: =IFERROR(INDEX(MyList,MATCH(SUBSTITUTE(MyList,"-",""),IF(ISNUMBER(FIND("-",MyList)),SUBSTITUTE(MyList,"-","")),)),MyList)
 
Upvote 0
MyListHyphen actually I no know how the second formula how works I put in another COL C but I did not see any thing changes
 
Upvote 0
Here's my workbook: MyList.xlsx

To create the name MyListHyphen, I used Formula/Name Manager/New ...
Name:=MyListHyphen
Refers to: =IFERROR(INDEX(MyList,MATCH(SUBSTITUTE(MyList,"-",""),IF(ISNUMBER(FIND("-",MyList)),SUBSTITUTE(MyList,"-","")),)),MyList)

We could combine into a single formula, but it's ugly:

=IFERROR(INDEX(IFERROR(INDEX(MyList,MATCH(SUBSTITUTE(MyList,"-",""),IF(ISNUMBER(FIND("-",MyList)),SUBSTITUTE(MyList,"-","")),)),MyList),MATCH(0,MMULT(--(IFERROR(INDEX(MyList,MATCH(SUBSTITUTE(MyList,"-",""),IF(ISNUMBER(FIND("-",MyList)),SUBSTITUTE(MyList,"-","")),)),MyList)=TRANSPOSE(B$1:B1)),ROW(INDIRECT("1:"&ROWS(B$1:B1)))^0),)),"")
 
Upvote 0
sorry for delaying to answer you , the problem seems version office because when I open your file and before enable the macro it shows the data as post#4 but when enable it just show the first value
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,694
Members
448,979
Latest member
DET4492

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