#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Compare arrays

Hello,
I need to compare a column with a set of columns and get the column number
that match the lookup column. Can somebody help? thanks!

lookup column:
1
2
3

A B C D E F
2 4 5 6 1 5
5 2 3 2 2 4
1 2 5 1 3 6

expected result is 5 (col E)


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Compare arrays

mavxob,

Assuming you will only have one match, with the 'lookup column' in J1:J3

=SUMPRODUCT((J1=A1:F1)*(J2=A2:F2)*(J3=A3:F3)*COLUM N(A1:F1))

HTH,
Bernie
MS Excel MVP


"mavxob" wrote in message
...
Hello,
I need to compare a column with a set of columns and get the column number
that match the lookup column. Can somebody help? thanks!

lookup column:
1
2
3

A B C D E F
2 4 5 6 1 5
5 2 3 2 2 4
1 2 5 1 3 6

expected result is 5 (col E)




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Compare arrays

Another play to try
Assuming source data in A1:F3, with "lookup col" in H1:H3
put in K1's formula bar, then array-enter the formula by pressing
CTRL+SHIFT+ENTER (instead of just pressing ENTER):
=MATCH(1,(A1:F1=H1)*(A2:F2=H2)*(A3:F3=H3),0)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"mavxob" wrote:
Hello,
I need to compare a column with a set of columns and get the column number
that match the lookup column. Can somebody help? thanks!

lookup column:
1
2
3

A B C D E F
2 4 5 6 1 5
5 2 3 2 2 4
1 2 5 1 3 6

expected result is 5 (col E)


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Compare arrays

Excellent ! thanks for your propmt feedback

"Bernie Deitrick" wrote:

mavxob,

Assuming you will only have one match, with the 'lookup column' in J1:J3

=SUMPRODUCT((J1=A1:F1)*(J2=A2:F2)*(J3=A3:F3)*COLUM N(A1:F1))

HTH,
Bernie
MS Excel MVP


"mavxob" wrote in message
...
Hello,
I need to compare a column with a set of columns and get the column number
that match the lookup column. Can somebody help? thanks!

lookup column:
1
2
3

A B C D E F
2 4 5 6 1 5
5 2 3 2 2 4
1 2 5 1 3 6

expected result is 5 (col E)





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Compare arrays

Thanks, this works as expected !

"Max" wrote:

Another play to try
Assuming source data in A1:F3, with "lookup col" in H1:H3
put in K1's formula bar, then array-enter the formula by pressing
CTRL+SHIFT+ENTER (instead of just pressing ENTER):
=MATCH(1,(A1:F1=H1)*(A2:F2=H2)*(A3:F3=H3),0)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"mavxob" wrote:
Hello,
I need to compare a column with a set of columns and get the column number
that match the lookup column. Can somebody help? thanks!

lookup column:
1
2
3

A B C D E F
2 4 5 6 1 5
5 2 3 2 2 4
1 2 5 1 3 6

expected result is 5 (col E)




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Compare arrays

Welcome, thanks for feeding back.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"mavxob" wrote in message
...
Thanks, this works as expected !



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
Compare arrays youngster Excel Worksheet Functions 3 July 31st 07 04:36 PM
How do I compare cells and if FALSE compare to next cell in EXCEL Cindie Excel Worksheet Functions 0 March 24th 06 05:29 PM
two arrays Jerry Kinder New Users to Excel 4 February 26th 06 08:29 AM
Arrays Dan Excel Worksheet Functions 3 September 15th 05 07:36 AM
Arrays [email protected] Setting up and Configuration of Excel 3 February 18th 05 02:43 AM


All times are GMT +1. The time now is 07:17 AM.

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"