Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
gnotnoel via OfficeKB.com
 
Posts: n/a
Default Matching Adjacent Columns?

I'm having trouble writing a formula to insert specific values from a column
that was a result of a match with a column adjacent to it.

Basically, I have three columns
-one is a list of names (AD66564..etc...etc..(machine #))
-second is a list with the values associated with these names (in this case,
the location of each machine, j5/4byprinter)
-third is another list of names (AD979879..etc..etc..)

On the forth column, I want to be able to match each name of the third column
with a name in the first column. So that if the name being tested matches the
name in the any row of the first colum, than it should display the value of
the second column that is adjacent to the first column. If not, than it
should display "no match".

I am able to use =match(C2,A:A,0) so that it displays the location of a match
with the first column. But I would rather want it to display the value of the
second column.

something like....=IF(Match(C2,A:A,0),B:B,"No Match") but this doesnt work!

Any help would be greatly appreciated :)

Noel

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Magnivy
 
Posts: n/a
Default Matching Adjacent Columns?

Try using a VLOOKUP as follows

=IF(ISERROR(VLOOKUP(C2,$A$1:$A5000,1,FALSE)),"No
Match",VLOOKUP(C2,$A$1:$A5000,1,FALSE))

"gnotnoel via OfficeKB.com" wrote:

I'm having trouble writing a formula to insert specific values from a column
that was a result of a match with a column adjacent to it.

Basically, I have three columns
-one is a list of names (AD66564..etc...etc..(machine #))
-second is a list with the values associated with these names (in this case,
the location of each machine, j5/4byprinter)
-third is another list of names (AD979879..etc..etc..)

On the forth column, I want to be able to match each name of the third column
with a name in the first column. So that if the name being tested matches the
name in the any row of the first colum, than it should display the value of
the second column that is adjacent to the first column. If not, than it
should display "no match".

I am able to use =match(C2,A:A,0) so that it displays the location of a match
with the first column. But I would rather want it to display the value of the
second column.

something like....=IF(Match(C2,A:A,0),B:B,"No Match") but this doesnt work!

Any help would be greatly appreciated :)

Noel

--
Message posted via http://www.officekb.com

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Magnivy
 
Posts: n/a
Default Matching Adjacent Columns?

Sorry, I made a mistake. Try

=IF(ISERROR(VLOOKUP,C2,$A$1:$A$500,1,FALSE)),"No Match",B2)

"Magnivy" wrote:

Try using a VLOOKUP as follows

=IF(ISERROR(VLOOKUP(C2,$A$1:$A5000,1,FALSE)),"No
Match",VLOOKUP(C2,$A$1:$A5000,1,FALSE))

"gnotnoel via OfficeKB.com" wrote:

I'm having trouble writing a formula to insert specific values from a column
that was a result of a match with a column adjacent to it.

Basically, I have three columns
-one is a list of names (AD66564..etc...etc..(machine #))
-second is a list with the values associated with these names (in this case,
the location of each machine, j5/4byprinter)
-third is another list of names (AD979879..etc..etc..)

On the forth column, I want to be able to match each name of the third column
with a name in the first column. So that if the name being tested matches the
name in the any row of the first colum, than it should display the value of
the second column that is adjacent to the first column. If not, than it
should display "no match".

I am able to use =match(C2,A:A,0) so that it displays the location of a match
with the first column. But I would rather want it to display the value of the
second column.

something like....=IF(Match(C2,A:A,0),B:B,"No Match") but this doesnt work!

Any help would be greatly appreciated :)

Noel

--
Message posted via http://www.officekb.com

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Matching Adjacent Columns?

maybe...
=if(isnumber(match(c2,A:a,0)),index(b:b,match(c2,a :a,0)),"No Match")
or
=IF(iserror(match(C2,a:a,0)),"no match",index(b:b,match(C2,A:A,0)))
or
=if(iserror(vlookup(c2,a:b,2,false)),"no match",vlookup(c2,a:b,2,false))

You may want to read Debra Dalgleish's notes:
http://www.contextures.com/xlFunctions02.html (for =vlookup())
and
http://www.contextures.com/xlFunctions03.html (for =index(match()))



"gnotnoel via OfficeKB.com" wrote:

I'm having trouble writing a formula to insert specific values from a column
that was a result of a match with a column adjacent to it.

Basically, I have three columns
-one is a list of names (AD66564..etc...etc..(machine #))
-second is a list with the values associated with these names (in this case,
the location of each machine, j5/4byprinter)
-third is another list of names (AD979879..etc..etc..)

On the forth column, I want to be able to match each name of the third column
with a name in the first column. So that if the name being tested matches the
name in the any row of the first colum, than it should display the value of
the second column that is adjacent to the first column. If not, than it
should display "no match".

I am able to use =match(C2,A:A,0) so that it displays the location of a match
with the first column. But I would rather want it to display the value of the
second column.

something like....=IF(Match(C2,A:A,0),B:B,"No Match") but this doesnt work!

Any help would be greatly appreciated :)

Noel

--
Message posted via http://www.officekb.com


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
gnotnoel via OfficeKB.com
 
Posts: n/a
Default Matching Adjacent Columns?

Thanks guys, it looks =if(isnumber(match(c2,A:a,0)),index(b:b,match(c2,a :a,0))
,"No Match")
worked the best for me.

Worked like wonders!

Noel

Dave Peterson wrote:
maybe...
=if(isnumber(match(c2,A:a,0)),index(b:b,match(c2, a:a,0)),"No Match")
or
=IF(iserror(match(C2,a:a,0)),"no match",index(b:b,match(C2,A:A,0)))
or
=if(iserror(vlookup(c2,a:b,2,false)),"no match",vlookup(c2,a:b,2,false))

You may want to read Debra Dalgleish's notes:
http://www.contextures.com/xlFunctions02.html (for =vlookup())
and
http://www.contextures.com/xlFunctions03.html (for =index(match()))

I'm having trouble writing a formula to insert specific values from a column
that was a result of a match with a column adjacent to it.

[quoted text clipped - 20 lines]

Noel



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200606/1
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
Matching two columns and their data [email protected] Excel Worksheet Functions 2 March 6th 06 08:17 PM
Matching Data in Columns ebraun01 Excel Worksheet Functions 7 January 14th 06 02:35 AM
Arithmetical Mode of Criteria in Multiple Non-Adjacent columns Sam via OfficeKB.com Excel Worksheet Functions 4 July 14th 05 09:15 PM
Copying multiple columns not adjacent Doug Wilson Excel Discussion (Misc queries) 2 July 8th 05 08:51 PM
Matching data in multiple columns BuddyB Excel Discussion (Misc queries) 1 February 27th 05 08:05 PM


All times are GMT +1. The time now is 09:18 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"