View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Too many nested IF functions!

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Skyscan" wrote in message
...
Thanks everyone for your assistance in answering this question for me. I
apologize for not being more clear in my description of the situation.
The
numbers 1-9 (another error I made in my problem description was that I
wrote
0 through 9!) are entered manually in a random order, but all 9 numbers
must
be represented.

The solution which Biff provided below resolved my situation completely!!!
THANKS SO MUCH!!

"T. Valko" wrote:

Try this:

=INDEX(C4:K4,MATCH(TRUE,INDEX(COUNTIF(C4:K4,C4:K4) 1,1,),0))

If more than one number is duplicated the formula will return the *first*
matched duplicate.

--
Biff
Microsoft Excel MVP


"Skyscan" wrote in message
...
I am trying to determine if a data array has duplicate numbers. The
numbers
in C4:K4 are randomly 0 through 9, however sometimes an error occurs
and a
duplicate number is inserted into the array. If a duplicate number is
entered, I want the duplicate number to show up in the cell. I am
running
up
against the max limit of 7 nested IF() functions. The function string
below
works, however I need to check for duplicate 8's and 9's. How can I
get
around this nested IF limit?

=IF(COUNTIF(C4:K4,"1")1,"1",IF(COUNTIF(C4:K4,"2") 1,"2",IF(COUNTIF(C4:K4,"3")1,"3",IF(COUNTIF(C4:K 4,"4")1,"4",IF(COUNTIF(C4:K4,"5")1,"5",IF(COUNTI F(C4:K4,"6")1,"6",IF(COUNTIF(C4:K4,"7")1,"7","") ))))))

Thank you in advance!!!

Tom