PC Review


Reply
Thread Tools Rate Thread

Comparing data, need help.

 
 
=?Utf-8?B?QWxsYW4=?=
Guest
Posts: n/a
 
      3rd Aug 2007
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 With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      4th Aug 2007

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" <(E-Mail Removed)>
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 With Quote
 
=?Utf-8?B?QWxsYW4=?=
Guest
Posts: n/a
 
      6th Aug 2007
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" <(E-Mail Removed)>
> 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 With Quote
 
Jim Cone
Guest
Posts: n/a
 
      6th Aug 2007

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" <(E-Mail Removed)>
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" <(E-Mail Removed)>
> 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 With Quote
 
=?Utf-8?B?QWxsYW4=?=
Guest
Posts: n/a
 
      6th Aug 2007
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" <(E-Mail Removed)>
> 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" <(E-Mail Removed)>
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Excel Data and Comparing to Existing Data Records Dean Microsoft Access 4 2nd Sep 2009 03:20 PM
comparing two columns of data and return unique data in another co ExcelUSER Microsoft Excel Misc 6 18th Jun 2009 02:10 PM
Comparing data between sheets, and copying rows with data =?Utf-8?B?Rmxlb25l?= Microsoft Excel Programming 1 2nd Jun 2006 06:54 PM
comparing data column in other worksheets and returning certain data fields Mary Microsoft Excel Worksheet Functions 5 2nd Feb 2004 08:02 PM
comparing data and return only data that exsist in the 2 columns victorwill Microsoft Excel Worksheet Functions 2 27th Dec 2003 12:13 AM


Features
 

Advertising
 

Newsgroups
 


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