Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / June 2007

Tip: Looking for answers? Try searching our database.

If condition in Excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Νικος - 24 Jun 2007 10:20 GMT
Hi.
I have a column in a Sheet (A10:A24) which has integer numbers (from 1 to
80). I would like to apply in the bottom cell A25 the condition: If all
numbers in column A10:A24 are different each other return “OK” else return
“R”.
Can anyone help me?
Thanks.
Roger Govier - 24 Jun 2007 10:46 GMT
Hi

Try
=IF(FREQUENCY(A10:A24,A10:A24)=1,"OK","R")

Signature

Regards

Roger Govier

> Hi.
> I have a column in a Sheet (A10:A24) which has integer numbers (from 1
[quoted text clipped - 6 lines]
> Can anyone help me?
> Thanks.
shah shailesh - 25 Jun 2007 04:17 GMT
You can check unique list in 2 ways.

1 Worksheet formula
2 UDF (user defined function)

1 Worksheet Formula
Put this formula in cell A25
=IF(INT(COUNTA(A10:A24)/SUMPRODUCT(COUNTIF(A10:A24,A10:A24))),"OK","R")

2 UDF (User Defined Function)
Put below code in Module, and in cell A25 put this formula
=IF(isunique(A10:A24),"OK","R")

If not familiar with UDF, VBA and macros, see David McRitchie's site for
more on "getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Function isUnique(rng As Range) As Boolean

    Dim myListCount, app As Application
    Set app = Application
    myListCount = app.CountA(rng)

    'use if condition to validate blank range
    'otherwise for blank range it shows error #Value!
    'if range is blank return 1=true or 0=false
    '1= list is uniqe
    '0=list is not uniqe

    'If myListCount = 0 Then
        'isUnique = 0 ' or 1     'Change to suit
        'Else
        isUnique = myListCount \ app.SumProduct(app.CountIf(rng, rng))
    'End If

End Function

Regards,
Shailesh Shah
http://in.geocities.com/shahshaileshs/
(Excel Add-ins Page)
If You Can't Excel with Talent, Triumph with Effort.

Keywords : check duplicate entery, repeat items,

> Hi.
> I have a column in a Sheet (A10:A24) which has integer numbers (from 1 to
[quoted text clipped - 3 lines]
> Can anyone help me?
> Thanks.
nikos - 25 Jun 2007 06:06 GMT
Thank you both.

> You can check unique list in 2 ways.
>
[quoted text clipped - 49 lines]
> > Can anyone help me?
> > Thanks.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.