Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to create a function that will tell me if X numbers out of 4
are equal. Something like: Function AnyXEqual(x As Integer, int1 As Integer, int2 As Integer, int3 As Integer, int4 As Integer) As Boolean '[code] End Function So AnyXEqual(3, 67, 50, 67, 98) = False AnyXEqual(2, 67, 50, 67, 98) = True AnyXEqual(4, 67, 50, 67, 67) = False AnyXEqual(3, 67, 50, 67, 67) = True AnyXEqual(2, 67, 50, 67, 67) = True I thought about using a For i = 1 to x loop (or 2) to compare them, but I think that would only work if x was 2 ... if x was 3 I would need a nested loop, and if x was 4 I would need another nested loop. Something tells me this is a perfect situation for a recursive function, but my brain has trouble thinking on that level. Any ideas? Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Recursive Functions...maybe | Excel Worksheet Functions | |||
compare 2 columns of numbers and place the matched numbers in a 3r | Excel Discussion (Misc queries) | |||
Recursive Functio help | Excel Worksheet Functions | |||
VLOOKUP should compare numbers stored as text to plain numbers. | Excel Worksheet Functions | |||
recursive sums | Excel Worksheet Functions |