View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Yossy Yossy is offline
external usenet poster
 
Posts: 127
Default Please Help!! VLOOKUP AND COMBINATION FUNCTION

Ooh sorry mike, the first code worked i.e(the IF code). I didn't set my range
properly at first that is why I got errors.

Another question. I also have 4 vertical bars each bar with High and Low
points. I will like to draw out the 2 possible combination of comparison of
the High and Low points of the bars. I used the COMBIN function =COMBIN(16,2)
= 120possibilities (Not sure if right)

E.g Bar49 Bar50 Bar51 Bar52
H9 H7 H12 H9
L3 L1 L7 L1

I want the code to compare all bars high and low points and display all the
possible comparison of High to High, High to Low, Low to Low and Low to High.
The result will be displayed like the following:
Bar49 High Bar50 High (i.e H9 is higher than H7)
Bar49 Low Bar50 Low
Bar49 High < Bar51 high
Bar49 High = Bar52 high
Bar50 High = Bar51 Low

etc. Please help me set this function. I might be wrong with the combination
however, I have oulined how the result should be. Many Thanks


"Yossy" wrote:

Thanks Mike
I set the range and copied the code right then pressed F5 but it gave me
this error "Range" of Object "- worksheet" failed. I tried both codes. Please
help me

"Mike H" wrote:

The if bit isn't necessary

Sub stantial()
Count = 1
For i = 1 To Application.WorksheetFunction.CountA(Range("myMate s"))
For j = i + 1 To Application.WorksheetFunction.CountA(Range("MyMate s"))
Name1 = Range("MyMates").Cells(i, 1)
Name2 = Range("MyMates").Cells(j, 1)
Cells(0 + Count, 1) = Name1
Cells(0 + Count, 2) = Name2
Count = Count + 1
Next j
Next i
End Sub

Mike

"Yossy" wrote:

Possible two-person teams that can be formed from 8 candidates (28) i.e
=COMBIN(8,2).

However, my question is Lets assume the list of all 8 candidates names' are
John, Dustin, Mary, David, Peter, Rossy, Liz and Mike. How do I get the list
of all the two-person team that will total 28. All help will be appreciated.

I was thinking of using the vlookup together with the COMBIN function but
can't figure it out. Let me know if there is a better way to acheive this.
Thanks