Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Excel for Mac > Re: How to look...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 8 Topic 319 of 342
Post > Topic >>

Re: How to look at the values in 8 columns, pick the two that have

by =?Utf-8?B?Sm9lbA==?= <Joel@[EMAIL PROTECTED] > Apr 3, 2008 at 08:26 AM

I modified my code from a subroutine to a function

call with
=compare_data(C4:J4,A4,B4)

Function compare_data(Data_Range As Range, First_Val, Second_Val)

Dim MyNumbers(2)

Count = 0
For Each cell In Data_Range
   If Not WorksheetFunction.IsNA(cell) Then
      MyNumbers(Count) = cell
      If Count = 1 Then Exit For
      Count = Count + 1
      
   End If
Next cell

If MyNumbers(0) = First_Val And _
   MyNumbers(1) = Second_Val Then
   
   compare_data = True
Else
   compare_data = False
End If
End Function


"Dany Adams" wrote:

> The two numbers to which the ³found² pair will be compared will be in
the
> same row, always in the same two columns. eg:
> 
> 2  5          1       6    #NA    #NA   #NA    #NA    #NA    #NA
> 6  2         #NA    #NA    #NA    #NA    2       2    #NA    #NA
> 3  2         #NA    #NA     3       7   #NA    #NA    #NA    #NA
> 1  4         #NA    #NA    #NA    #NA   #NA    #NA     6      8
> 
> 
> On 4/3/08 7:19 AM, in article
> 3DF7FEDA-B46F-4FCE-BA5B-852236D6D578@[EMAIL PROTECTED]
 "Mark Ivey"
> <wmivey6311NOSPAM@[EMAIL PROTECTED]
> wrote:
> 
> > For each row... these two numbers could be added to an array and then
used
> > as a comparison tool.
> > 
> > Where are the other two number going to be located? Will they be
located
> > there for each row that is evaluated?
> > 
> > Mark
> > 
> > "Michael Levin" <mlevin666@[EMAIL PROTECTED]
> wrote in message
> > news:C419FF79.665FE%mlevin666@[EMAIL PROTECTED]
> >> I'm trying to write a function that can look at the values in eight
> >> columns
> >> of a row, pick the two columns that have actual numbers (as opposed
to
> >> NAs),
> >> then compare those two numbers to another pair of numbers.  Anyone
know
> >> how
> >> to write a function that can search that way ?
> >> 
> >> Thanks,
> >> 
> >> Mike
> >> 
> 
> 
>
 




 8 Posts in Topic:
How to look at the values in 8 columns, pick the two that have
Michael Levin <mlevin6  2008-04-03 03:28:57 
Re: How to look at the values in 8 columns, pick the two that ha
"Mark Ivey" <  2008-04-03 06:19:29 
Re: How to look at the values in 8 columns, pick the two that
Dany Adams <dadams@[EM  2008-04-03 10:52:23 
Re: How to look at the values in 8 columns, pick the two that ha
=?Utf-8?B?Sm9lbA==?= <  2008-04-03 08:26:03 
Re: How to look at the values in 8 columns, pick the two that ha
Dany Adams <dadams@[EM  2008-04-03 14:33:51 
Re: How to look at the values in 8 columns, pick the two that ha
Dany Adams <dadams@[EM  2008-04-03 14:50:03 
Re: How to look at the values in 8 columns, pick the two that ha
Dany Adams <dadams@[EM  2008-04-04 17:02:32 
RE: How to look at the values in 8 columns, pick the two that ha
=?Utf-8?B?Sm9lbA==?= <  2008-04-03 04:27:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 17:42:02 CDT 2008.