Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default compare column1 with column2


Hi,

How do i compare column1 with column2 and output in column3.

ex.

column1 column2 output

test1 test4 test1
test2 test6 test2
test4 test1 test4
test6 test2 test6

Thanks for you help.


--
myguess21
------------------------------------------------------------------------
myguess21's Profile: http://www.excelforum.com/member.php...o&userid=29578
View this thread: http://www.excelforum.com/showthread...hreadid=492781

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default compare column1 with column2

You have not told use what criterion to use in the output column.
Do you want the largest of the two values?
either =MAX(A1:B1) or IF(A1B1,A1,B1)
copy down the column
best wishes

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"myguess21" wrote
in message ...

Hi,

How do i compare column1 with column2 and output in column3.

ex.

column1 column2 output

test1 test4 test1
test2 test6 test2
test4 test1 test4
test6 test2 test6

Thanks for you help.


--
myguess21
------------------------------------------------------------------------
myguess21's Profile:
http://www.excelforum.com/member.php...o&userid=29578
View this thread: http://www.excelforum.com/showthread...hreadid=492781



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default compare column1 with column2


Thanks for quick response.

No this is string. Just want to search the value from column 2 i
column1 if found out put in column 3

--
myguess2
-----------------------------------------------------------------------
myguess21's Profile: http://www.excelforum.com/member.php...fo&userid=2957
View this thread: http://www.excelforum.com/showthread.php?threadid=49278

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default compare column1 with column2

in C1
=if(match(B1,A:A,0),A1,"")

then drag fill down the column.

--
Regards,
Tom Ogilvy

"myguess21" wrote in
message ...

Thanks for quick response.

No this is string. Just want to search the value from column 2 in
column1 if found out put in column 3.


--
myguess21
------------------------------------------------------------------------
myguess21's Profile:

http://www.excelforum.com/member.php...o&userid=29578
View this thread: http://www.excelforum.com/showthread...hreadid=492781



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default compare column1 with column2

Some formulas to try:
=IF(A1=B1,A1,"")
=IF(FIND(B1,A1),A1,"")
=IF(SEARCH(B1,A1),A1,"")
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"myguess21" wrote in
message ...

Thanks for quick response.

No this is string. Just want to search the value from column 2 in
column1 if found out put in column 3.


--
myguess21
------------------------------------------------------------------------
myguess21's Profile:
http://www.excelforum.com/member.php...o&userid=29578
View this thread: http://www.excelforum.com/showthread...hreadid=492781





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default compare column1 with column2

Oh dear I mean to use MATCH not FIND!
Time to retire!!!

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Bernard Liengme" wrote in message
...
Some formulas to try:
=IF(A1=B1,A1,"")
=IF(FIND(B1,A1),A1,"")
=IF(SEARCH(B1,A1),A1,"")
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"myguess21" wrote
in message ...

Thanks for quick response.

No this is string. Just want to search the value from column 2 in
column1 if found out put in column 3.


--
myguess21
------------------------------------------------------------------------
myguess21's Profile:
http://www.excelforum.com/member.php...o&userid=29578
View this thread:
http://www.excelforum.com/showthread...hreadid=492781





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default compare column1 with column2

Is this is what you meant? (Search col A for each element in col B?)

=IF(MATCH(B1,A:A,0),B1,"")

red blue blue
green white white
blue yellow #N/A
black black black
white blue blue

but in both cases how do you get rid of "#N/A" when there is no match?

"Tom Ogilvy" wrote:

in C1
=if(match(B1,A:A,0),A1,"")

then drag fill down the column.

--
Regards,
Tom Ogilvy

"myguess21" wrote in
message ...

Thanks for quick response.

No this is string. Just want to search the value from column 2 in
column1 if found out put in column 3.


--
myguess21
------------------------------------------------------------------------
myguess21's Profile:

http://www.excelforum.com/member.php...o&userid=29578
View this thread: http://www.excelforum.com/showthread...hreadid=492781




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default compare column1 with column2

Should actually be:

=if(isnumber(match(B1,A:A,0)),A1,"")

--
Regards,
Tom Ogilvy



"Tom Ogilvy" wrote in message
...
in C1
=if(match(B1,A:A,0),A1,"")

then drag fill down the column.

--
Regards,
Tom Ogilvy

"myguess21" wrote

in
message ...

Thanks for quick response.

No this is string. Just want to search the value from column 2 in
column1 if found out put in column 3.


--
myguess21
------------------------------------------------------------------------
myguess21's Profile:

http://www.excelforum.com/member.php...o&userid=29578
View this thread:

http://www.excelforum.com/showthread...hreadid=492781





  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default compare column1 with column2

Not if you look at the OP's example. It is as I wrote it and I posted a
correction to account for the N/A.

--
Regards,
Tom Ogilvy



"Charlie" wrote in message
...
Is this is what you meant? (Search col A for each element in col B?)

=
IF(MATCH(B1,A:A,0),B1,"")
red blue blue
green white white
blue yellow #N/A
black black black
white blue blue

but in both cases how do you get rid of "#N/A" when there is no match?

"Tom Ogilvy" wrote:

in C1
=if(match(B1,A:A,0),A1,"")

then drag fill down the column.

--
Regards,
Tom Ogilvy

"myguess21"

wrote in
message ...

Thanks for quick response.

No this is string. Just want to search the value from column 2 in
column1 if found out put in column 3.


--
myguess21


------------------------------------------------------------------------
myguess21's Profile:

http://www.excelforum.com/member.php...o&userid=29578
View this thread:

http://www.excelforum.com/showthread...hreadid=492781






  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default compare column1 with column2

The original example seems a little unusual. Maybe it's a VLookup problem:

=VLOOKUP(B1,A:B,2,FALSE)

test1 test4 test3
test2 test6 test5
test4 test3 test1
test6 test5 #N/A
test3 test1 test4


"Tom Ogilvy" wrote:

in C1
=if(match(B1,A:A,0),A1,"")

then drag fill down the column.

--
Regards,
Tom Ogilvy

"myguess21" wrote in
message ...

Thanks for quick response.

No this is string. Just want to search the value from column 2 in
column1 if found out put in column 3.


--
myguess21
------------------------------------------------------------------------
myguess21's Profile:

http://www.excelforum.com/member.php...o&userid=29578
View this thread: http://www.excelforum.com/showthread...hreadid=492781






  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default compare column1 with column2

P.S. thanks for the #N/A correction

"Tom Ogilvy" wrote:

Not if you look at the OP's example. It is as I wrote it and I posted a
correction to account for the N/A.

--
Regards,
Tom Ogilvy



"Charlie" wrote in message
...
Is this is what you meant? (Search col A for each element in col B?)

=
IF(MATCH(B1,A:A,0),B1,"")
red blue blue
green white white
blue yellow #N/A
black black black
white blue blue

but in both cases how do you get rid of "#N/A" when there is no match?

"Tom Ogilvy" wrote:

in C1
=if(match(B1,A:A,0),A1,"")

then drag fill down the column.

--
Regards,
Tom Ogilvy

"myguess21"

wrote in
message ...

Thanks for quick response.

No this is string. Just want to search the value from column 2 in
column1 if found out put in column 3.


--
myguess21

------------------------------------------------------------------------
myguess21's Profile:
http://www.excelforum.com/member.php...o&userid=29578
View this thread:

http://www.excelforum.com/showthread...hreadid=492781







  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default compare column1 with column2


Yes. this is what i need to do.

Thanks a lot.



Charlie Wrote:
Is this is what you meant? (Search col A for each element in col B?)

=IF(MATCH(B1,A:A,0),B1,"")

red blue blue
green white white
blue yellow #N/A
black black black
white blue blue

but in both cases how do you get rid of "#N/A" when there is no match?

"Tom Ogilvy" wrote:

in C1
=if(match(B1,A:A,0),A1,"")

then drag fill down the column.

--
Regards,
Tom Ogilvy

"myguess21"

wrote in
message

...

Thanks for quick response.

No this is string. Just want to search the value from column 2 in
column1 if found out put in column 3.


--
myguess21

------------------------------------------------------------------------
myguess21's Profile:

http://www.excelforum.com/member.php...o&userid=29578
View this thread:

http://www.excelforum.com/showthread...hreadid=492781






--
myguess21
------------------------------------------------------------------------
myguess21's Profile: http://www.excelforum.com/member.php...o&userid=29578
View this thread: http://www.excelforum.com/showthread...hreadid=492781

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
Column1 and Column2 beata Excel Worksheet Functions 2 December 12th 07 10:16 PM
Column1 and Column2 beata Excel Worksheet Functions 0 December 12th 07 07:41 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
Compare.xla Bill Le May Excel Programming 7 August 9th 04 06:41 PM
compare data from one column with another and compare result to yet another Matt Williamson[_3_] Excel Programming 1 September 25th 03 08:54 PM


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