Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Comparing data, need help.

Hello,

I am new to Excel VBA and needs some help with this comparing data between
columns. Column A and Column B are comparing with each others. Column A has
10 rows and column B has 5. If it matches, then output "TRUE" otherwise
"False" on Column C, outputs are on the same row as the letter it matches of
Column B. In this case Column C, row 3 and row 5. It is much easier if it
compare straight across using IF Else but this not the case. Thank you very
much for the help.

Allan

For example.

Column A: Column B: Column C:

Row 1 A U FALSE
Row 2 B X FALSE
Row 3 C G TRUE
Row 4 D Y FALSE
Row 5 E H TRUE
Row 6 F
Row 7 G
Row 8 H
Row 9 I
Row 10 J









  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Comparing data, need help.


As you didn't post any code, will you settle for a worksheet formula?...
Enter in C1 and fill down...
=COUNTIF(A:A,B1)0
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Allan"
wrote in message
Hello,
I am new to Excel VBA and needs some help with this comparing data between
columns. Column A and Column B are comparing with each others. Column A has
10 rows and column B has 5. If it matches, then output "TRUE" otherwise
"False" on Column C, outputs are on the same row as the letter it matches of
Column B. In this case Column C, row 3 and row 5. It is much easier if it
compare straight across using IF Else but this not the case. Thank you very
much for the help.
Allan
For example.
Column A: Column B: Column C:

Row 1 A U FALSE
Row 2 B X FALSE
Row 3 C G TRUE
Row 4 D Y FALSE
Row 5 E H TRUE
Row 6 F
Row 7 G
Row 8 H
Row 9 I
Row 10 J









  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Comparing data, need help.

Thank you Jim, yes it works. Another case, if it is true, can I assign a
value to it.

For instance.
True=A
False=B

lets make a new row in D1 for the value of true and false.

Thanks much.
Allan



"Jim Cone" wrote:


As you didn't post any code, will you settle for a worksheet formula?...
Enter in C1 and fill down...
=COUNTIF(A:A,B1)0
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Allan"
wrote in message
Hello,
I am new to Excel VBA and needs some help with this comparing data between
columns. Column A and Column B are comparing with each others. Column A has
10 rows and column B has 5. If it matches, then output "TRUE" otherwise
"False" on Column C, outputs are on the same row as the letter it matches of
Column B. In this case Column C, row 3 and row 5. It is much easier if it
compare straight across using IF Else but this not the case. Thank you very
much for the help.
Allan
For example.
Column A: Column B: Column C:

Row 1 A U FALSE
Row 2 B X FALSE
Row 3 C G TRUE
Row 4 D Y FALSE
Row 5 E H TRUE
Row 6 F
Row 7 G
Row 8 H
Row 9 I
Row 10 J










  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Comparing data, need help.


You are welcome.
Try this...
=IF(COUNTIF(A:A,B1)0,"A","B")
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Allan"
wrote in message
Thank you Jim, yes it works. Another case, if it is true, can I assign a
value to it.
For instance.
True=A
False=B
lets make a new row in D1 for the value of true and false.
Thanks much.
Allan



"Jim Cone" wrote:
As you didn't post any code, will you settle for a worksheet formula?...
Enter in C1 and fill down...
=COUNTIF(A:A,B1)0
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Allan"
wrote in message
Hello,
I am new to Excel VBA and needs some help with this comparing data between
columns. Column A and Column B are comparing with each others. Column A has
10 rows and column B has 5. If it matches, then output "TRUE" otherwise
"False" on Column C, outputs are on the same row as the letter it matches of
Column B. In this case Column C, row 3 and row 5. It is much easier if it
compare straight across using IF Else but this not the case. Thank you very
much for the help.
Allan
For example.
Column A: Column B: Column C:

Row 1 A U FALSE
Row 2 B X FALSE
Row 3 C G TRUE
Row 4 D Y FALSE
Row 5 E H TRUE
Row 6 F
Row 7 G
Row 8 H
Row 9 I
Row 10 J


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Comparing data, need help.

Very nice. Thank you so much. Definitely make my work easier.

Allan



"Jim Cone" wrote:


You are welcome.
Try this...
=IF(COUNTIF(A:A,B1)0,"A","B")
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Allan"
wrote in message
Thank you Jim, yes it works. Another case, if it is true, can I assign a
value to it.
For instance.
True=A
False=B
lets make a new row in D1 for the value of true and false.
Thanks much.
Allan



"Jim Cone" wrote:
As you didn't post any code, will you settle for a worksheet formula?...
Enter in C1 and fill down...
=COUNTIF(A:A,B1)0
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Allan"
wrote in message
Hello,
I am new to Excel VBA and needs some help with this comparing data between
columns. Column A and Column B are comparing with each others. Column A has
10 rows and column B has 5. If it matches, then output "TRUE" otherwise
"False" on Column C, outputs are on the same row as the letter it matches of
Column B. In this case Column C, row 3 and row 5. It is much easier if it
compare straight across using IF Else but this not the case. Thank you very
much for the help.
Allan
For example.
Column A: Column B: Column C:

Row 1 A U FALSE
Row 2 B X FALSE
Row 3 C G TRUE
Row 4 D Y FALSE
Row 5 E H TRUE
Row 6 F
Row 7 G
Row 8 H
Row 9 I
Row 10 J



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
comparing two columns of data and return unique data in another co ExcelUSER Excel Discussion (Misc queries) 6 June 18th 09 02:10 PM
Comparing data between sheets, and copying rows with data Fleone Excel Programming 1 June 2nd 06 06:54 PM
help comparing two sets od data to find the odd data matsgullis Excel Worksheet Functions 2 January 12th 06 01:52 AM
comparing lists of data to remove duplicate data Tom Excel Discussion (Misc queries) 2 October 13th 05 06:16 PM
Comparing data in two columns and highlighting the data David Kinsley Excel Worksheet Functions 6 January 4th 05 06:01 PM


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