PC Review


Reply
Thread Tools Rate Thread

Compare rows

 
 
Jan Kronsell
Guest
Posts: n/a
 
      15th Jan 2009
I column A to J, row 1 and two I have numbers between 1 and 9.

It might look like this

1 1 1 2 3 1 1 1 1 1
1 1 1 1 8 2 1 1 1 1

What I need is a function that compares the two rows, like this:

If J1 and J2 contains the same number, it must be counted.
Next it should test i I1 and I2 contaisn the same number. I n that case it
should be addes to the counter.
The code should go on like this until it meets to numbers, thatr are not the
same. Then it should stop counting and return the resulat of the counter.

In other words it shold compare the numbers in row 1 and 2, going backwatrds
from column J to column A. The first time two numbers are not the same, it
should stop, and return the number counted.

Maby the function could be entered like =COUNTALIKE(A1:J2) and the above
caee the result should be 4 as there are four numbers, that are the same,
before the that are not.

Jan







 
Reply With Quote
 
 
 
 
Jan Kronsell
Guest
Posts: n/a
 
      18th Jan 2009
Thank you both, I choose to use the formula solutuion,

Jan

Rick Rothstein wrote:
> This array-entered** formula should do what you want...
>
> =10-MAX(IF(A1:J1<>A2:J2,COLUMN(A1:J1),0))
>
> **Commit formula using Ctrl+Shift+Enter, not just Enter by itself.
>
> Note... the value of 10 represents the column number of the last
> column in the range (Column J is the 10th column).
>
>
> "Jan Kronsell" <kronsell(nomorespam)@adslhome.dk> wrote in message
> news:OBJoF%(E-Mail Removed)...
>> I column A to J, row 1 and two I have numbers between 1 and 9.
>>
>> It might look like this
>>
>> 1 1 1 2 3 1 1 1 1 1
>> 1 1 1 1 8 2 1 1 1 1
>>
>> What I need is a function that compares the two rows, like this:
>>
>> If J1 and J2 contains the same number, it must be counted.
>> Next it should test i I1 and I2 contaisn the same number. I n that
>> case it should be addes to the counter.
>> The code should go on like this until it meets to numbers, thatr are
>> not the same. Then it should stop counting and return the resulat of
>> the counter.
>>
>> In other words it shold compare the numbers in row 1 and 2, going
>> backwatrds from column J to column A. The first time two numbers are
>> not the same, it should stop, and return the number counted.
>>
>> Maby the function could be entered like =COUNTALIKE(A1:J2) and the
>> above caee the result should be 4 as there are four numbers, that
>> are the same, before the that are not.
>>
>> Jan



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare two files and merge rows base on a matching word within thesetwo rows mshak Microsoft Excel Programming 1 9th Dec 2009 01:34 AM
Re: Compare rows Rick Rothstein Microsoft Excel Programming 0 15th Jan 2009 06:59 PM
RE: Compare rows Joel Microsoft Excel Programming 0 15th Jan 2009 06:57 PM
Compare rows? sandernoteborn Microsoft Excel Worksheet Functions 6 8th May 2006 05:47 PM
compare rows... Jim C. Microsoft Excel Programming 0 1st Aug 2003 04:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:38 PM.