Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Comparing different length columns

I am comparing a 100 row column to a 15000 row column on another sheet and
want to return all matches.

Ex:

A B C G H
112 3 $A$1 112 2
112 5 $A$2 112 3
118 6 $A$3 115 5
118 2
118 3
118 6

On (column I1) I am going to use:
=IF(AND($A$1:$A$20=$G1, $B$1:$B$20=$H1), SMALL($C$1:$C$20, ROW(1:1)), 0)

But my problem is that the ROW(1:1) increments to ROW(6:6), which contains
nothing and $G6 and $H6 match $A3 and $B3 respectively...how do I return
ROW(3:3) if that is where the match occurs?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Comparing different length columns

If you are trying to identify matches in A1:B20 for each G1&H1 combination use

in I1
SUMPRODUCT(--($A$1:$A$20=G2),--($B$1:$B$20=H2))
which will return the number of matches..

OR
=IF(SUMPRODUCT(--($A$1:$A$20=G2),--($B$1:$B$20=H2))0,"Match found","")

If this post helps click Yes
---------------
Jacob Skaria


"OperationsNETTC15" wrote:

I am comparing a 100 row column to a 15000 row column on another sheet and
want to return all matches.

Ex:

A B C G H
112 3 $A$1 112 2
112 5 $A$2 112 3
118 6 $A$3 115 5
118 2
118 3
118 6

On (column I1) I am going to use:
=IF(AND($A$1:$A$20=$G1, $B$1:$B$20=$H1), SMALL($C$1:$C$20, ROW(1:1)), 0)

But my problem is that the ROW(1:1) increments to ROW(6:6), which contains
nothing and $G6 and $H6 match $A3 and $B3 respectively...how do I return
ROW(3:3) if that is where the match occurs?

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Comparing different length columns

Thanks alot!

That worked better than the 15 formulas I had tried before....however, is
there a way to return the column and cell number instead of just a 1 or a
"Match Found"?

If instead I'd get back $A$3 or something to that effect, I could
concatenate it into another formula and I'd be done with this nightmare
project.



"Jacob Skaria" wrote:

If you are trying to identify matches in A1:B20 for each G1&H1 combination use

in I1
SUMPRODUCT(--($A$1:$A$20=G2),--($B$1:$B$20=H2))
which will return the number of matches..

OR
=IF(SUMPRODUCT(--($A$1:$A$20=G2),--($B$1:$B$20=H2))0,"Match found","")

If this post helps click Yes
---------------
Jacob Skaria


"OperationsNETTC15" wrote:

I am comparing a 100 row column to a 15000 row column on another sheet and
want to return all matches.

Ex:

A B C G H
112 3 $A$1 112 2
112 5 $A$2 112 3
118 6 $A$3 115 5
118 2
118 3
118 6

On (column I1) I am going to use:
=IF(AND($A$1:$A$20=$G1, $B$1:$B$20=$H1), SMALL($C$1:$C$20, ROW(1:1)), 0)

But my problem is that the ROW(1:1) increments to ROW(6:6), which contains
nothing and $G6 and $H6 match $A3 and $B3 respectively...how do I return
ROW(3:3) if that is where the match occurs?

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Comparing different length columns

I achieved a workaround by separating my criteria by worksheet instead of
formula. Instead of IF(VALUE = 1 thru 9, do this), I took VALUES 1-9 and
gave them each a worksheet of their own, then matched them separately.

"OperationsNETTC15" wrote:

Thanks alot!

That worked better than the 15 formulas I had tried before....however, is
there a way to return the column and cell number instead of just a 1 or a
"Match Found"?

If instead I'd get back $A$3 or something to that effect, I could
concatenate it into another formula and I'd be done with this nightmare
project.



"Jacob Skaria" wrote:

If you are trying to identify matches in A1:B20 for each G1&H1 combination use

in I1
SUMPRODUCT(--($A$1:$A$20=G2),--($B$1:$B$20=H2))
which will return the number of matches..

OR
=IF(SUMPRODUCT(--($A$1:$A$20=G2),--($B$1:$B$20=H2))0,"Match found","")

If this post helps click Yes
---------------
Jacob Skaria


"OperationsNETTC15" wrote:

I am comparing a 100 row column to a 15000 row column on another sheet and
want to return all matches.

Ex:

A B C G H
112 3 $A$1 112 2
112 5 $A$2 112 3
118 6 $A$3 115 5
118 2
118 3
118 6

On (column I1) I am going to use:
=IF(AND($A$1:$A$20=$G1, $B$1:$B$20=$H1), SMALL($C$1:$C$20, ROW(1:1)), 0)

But my problem is that the ROW(1:1) increments to ROW(6:6), which contains
nothing and $G6 and $H6 match $A3 and $B3 respectively...how do I return
ROW(3:3) if that is where the match occurs?

Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
pre-set the length of columns Dave[_8_] New Users to Excel 1 September 6th 08 04:07 PM
Graphing Variable-length columns Ben M Charts and Charting in Excel 3 May 10th 06 06:23 PM
Combining multiple length columns to one Wingman Excel Discussion (Misc queries) 5 May 10th 06 02:04 AM
Referencing a Value in variable length columns. Kevin Excel Worksheet Functions 11 January 28th 06 11:01 AM
different length columns dsal Excel Discussion (Misc queries) 5 July 5th 05 06:27 PM


All times are GMT +1. The time now is 03:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"