Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

Compare arrays

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mavxob - 06 Mar 2008 13:49 GMT
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)
Bernie Deitrick - 06 Mar 2008 14:10 GMT
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)*COLUMN(A1:F1))

HTH,
Bernie
MS Excel MVP

> Hello,
> I need to compare a column with a set of columns and get the column number
[quoted text clipped - 11 lines]
>
> expected result is 5 (col E)
mavxob - 06 Mar 2008 14:57 GMT
Excellent ! thanks for your propmt feedback

> mavxob,
>
[quoted text clipped - 21 lines]
> >
> > expected result is 5 (col E)
Max - 06 Mar 2008 14:36 GMT
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)
Signature

Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

> Hello,
> I need to compare a column with a set of columns and get the column number
[quoted text clipped - 11 lines]
>
> expected result is 5 (col E)
mavxob - 06 Mar 2008 14:58 GMT
Thanks, this works as expected !

> Another play to try
> Assuming source data in A1:F3, with "lookup col" in H1:H3
[quoted text clipped - 16 lines]
> >
> > expected result is 5 (col E)
Max - 06 Mar 2008 22:55 GMT
Welcome, thanks for feeding back.
Signature

Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

> Thanks, this works as expected !
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.