#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default duplicated values

Hi Everyone,
I have a following formula in D1
"=IF(COUNTIF($A$1:$B$20,A1)=1,A1,"")"
but the problem I just want enter in a cell in a sequence, if the value
is udplicated then look for the next cell. I tried folling but I think
I`m completely wrong, because the code is not working:)
Dim x, n
Dim ncell
For n = 1 To 19
ncell = Sheet2.Range("b" & n)
x = Application.WorksheetFunction.CountIf(Sheet1.Range ("a1:b10"),
ncell)
If x = 1 Then
Sheet2.Range("d" & n) = Sheet2.Range("b" & n)
n = n + 1
End If
Next
can anyone help me?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default duplicated values

Try this:

=IF(ISERR(SMALL(IF(COUNTIF($A$1:$B$20,$A$1:$A$20)= 1,ROW(INDIRECT("1:"&ROWS($A$1:$A$20)))),ROWS($1:1) )),"",INDEX($A$1:$A$20,SMALL(IF(COUNTIF($A$1:$B$20 ,$A$1:$A$20)=1,ROW(INDIRECT("1:"&ROWS($A$1:$A$20)) )),ROWS($1:1))))

ctrl+shift+enter (not just enter)
copy down as far as needed



"baha" wrote:

Hi Everyone,
I have a following formula in D1
"=IF(COUNTIF($A$1:$B$20,A1)=1,A1,"")"
but the problem I just want enter in a cell in a sequence, if the value
is udplicated then look for the next cell. I tried folling but I think
I`m completely wrong, because the code is not working:)
Dim x, n
Dim ncell
For n = 1 To 19
ncell = Sheet2.Range("b" & n)
x = Application.WorksheetFunction.CountIf(Sheet1.Range ("a1:b10"),
ncell)
If x = 1 Then
Sheet2.Range("d" & n) = Sheet2.Range("b" & n)
n = n + 1
End If
Next
can anyone help me?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default duplicated values

thanks a lot for your help. i works fine fine, i just addjust those $
arrays,then ok .
thank you again
baha
Teethless mama wrote:
Try this:

=IF(ISERR(SMALL(IF(COUNTIF($A$1:$B$20,$A$1:$A$20)= 1,ROW(INDIRECT("1:"&ROWS($A$1:$A$20)))),ROWS($1:1) )),"",INDEX($A$1:$A$20,SMALL(IF(COUNTIF($A$1:$B$20 ,$A$1:$A$20)=1,ROW(INDIRECT("1:"&ROWS($A$1:$A$20)) )),ROWS($1:1))))

ctrl+shift+enter (not just enter)
copy down as far as needed



"baha" wrote:

Hi Everyone,
I have a following formula in D1
"=IF(COUNTIF($A$1:$B$20,A1)=1,A1,"")"
but the problem I just want enter in a cell in a sequence, if the value
is udplicated then look for the next cell. I tried folling but I think
I`m completely wrong, because the code is not working:)
Dim x, n
Dim ncell
For n = 1 To 19
ncell = Sheet2.Range("b" & n)
x = Application.WorksheetFunction.CountIf(Sheet1.Range ("a1:b10"),
ncell)
If x = 1 Then
Sheet2.Range("d" & n) = Sheet2.Range("b" & n)
n = n + 1
End If
Next
can anyone help me?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of values office guy10 Excel Discussion (Misc queries) 2 September 22nd 06 07:28 PM
Referencing a specific number to more general values in a table. AJL Excel Worksheet Functions 0 September 19th 06 05:11 PM
values not appearing in autofilter list maryj Excel Discussion (Misc queries) 5 September 13th 06 10:38 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Keeping a cell value constant trhoughout a list of values borikua05 Excel Worksheet Functions 2 December 3rd 05 03:03 PM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"