PC Review


Reply
Thread Tools Rate Thread

Comparing characters in cells

 
 
GVinIL
Guest
Posts: n/a
 
      26th May 2007
I am trying to create a column (column C) that contains values only
when the cell contents of column A and the cell contents of column B
are EXACT matches.

The characters in BOTH columns contain names of companies so there are
both alpha and numeric values.

The first FIVE characters (including spaces) of each line already
match EXACTLY... see example below.

I want column C to show a value only when ALL of the characters in the
cell in column A match EXACTLY to all of the characters in the cell in
column B.

I am running excel 2007 but could run an older version if needed.
....

The first five characters of each line are EXACT but the characters
after character number 5 MAY not be exact.
i.e.
Column A: Column
B: Column C:
MICROSOFT.PUBLIC.EXCEL MICROSOFT.PUBLIC.WORD
Able Body Labor Able Real Estate Usa, Inc.
ABN AMRO Abn Amro Inc.
Integrity Windows and Doors Integrity Windows and Doors
Integrity Windows and Doors
Central DuPage Hospital Centron Industries Inc.

As you can see in this example the first five characters of each
column match, but the rest of the cell characters do not match so
there is not a value in Column C. Except for Integrity Windows and
Doors. The characters in the cell in column A match EXACTLY to the
characters in the cell in column B so there is now a value in Column
B. This is a COMPLETE and EXACT match.

I apologize for the length of this post and am open for clarification
question.
Thank you in advance.

 
Reply With Quote
 
 
 
 
GVinIL
Guest
Posts: n/a
 
      26th May 2007
On May 26, 6:56 am, GVinIL <gronent...@visanow.com> wrote:
> I am trying to create a column (column C) that contains values only
> when the cell contents of column A and the cell contents of column B
> are EXACT matches.
>
> The characters in BOTH columns contain names of companies so there are
> both alpha and numeric values.
>
> The first FIVE characters (including spaces) of each line already
> match EXACTLY... see example below.
>
> I want column C to show a value only when ALL of the characters in the
> cell in column A match EXACTLY to all of the characters in the cell in
> column B.
>
> I am running excel 2007 but could run an older version if needed.
> ...
>
> The first five characters of each line are EXACT but the characters
> after character number 5 MAY not be exact.
> i.e.
> Column A: Column
> B: Column C:
> MICROSOFT.PUBLIC.EXCEL MICROSOFT.PUBLIC.WORD
> Able Body Labor Able Real Estate Usa, Inc.
> ABN AMRO Abn Amro Inc.
> Integrity Windows and Doors Integrity Windows and Doors
> Integrity Windows and Doors
> Central DuPage Hospital Centron Industries Inc.
>
> As you can see in this example the first five characters of each
> column match, but the rest of the cell characters do not match so
> there is not a value in Column C. Except for Integrity Windows and
> Doors. The characters in the cell in column A match EXACTLY to the
> characters in the cell in column B so there is now a value in Column
> B. This is a COMPLETE and EXACT match.
>
> I apologize for the length of this post and am open for clarification
> question.
> Thank you in advance.


Further example:
Column A: Column B: Column C:
abc1234 abc1233
123ert 123ern
4 5ngw 4 5ngw 4 5ngw
hl8 gi hl8 xi
n82 ./! n82 ./! n82 ./!

Hope this clears things up a bit. The first example I gave was too
long for the site and wrapped the text,

 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      26th May 2007
On 26 May 2007 04:56:47 -0700, GVinIL <(E-Mail Removed)> wrote:

>I am trying to create a column (column C) that contains values only
>when the cell contents of column A and the cell contents of column B
>are EXACT matches.
>
>The characters in BOTH columns contain names of companies so there are
>both alpha and numeric values.
>
>The first FIVE characters (including spaces) of each line already
>match EXACTLY... see example below.
>
>I want column C to show a value only when ALL of the characters in the
>cell in column A match EXACTLY to all of the characters in the cell in
>column B.
>
>I am running excel 2007 but could run an older version if needed.
>...
>
>The first five characters of each line are EXACT but the characters
>after character number 5 MAY not be exact.
>i.e.
>Column A: Column
>B: Column C:
>MICROSOFT.PUBLIC.EXCEL MICROSOFT.PUBLIC.WORD
>Able Body Labor Able Real Estate Usa, Inc.
>ABN AMRO Abn Amro Inc.
>Integrity Windows and Doors Integrity Windows and Doors
>Integrity Windows and Doors
>Central DuPage Hospital Centron Industries Inc.
>
>As you can see in this example the first five characters of each
>column match, but the rest of the cell characters do not match so
>there is not a value in Column C. Except for Integrity Windows and
>Doors. The characters in the cell in column A match EXACTLY to the
>characters in the cell in column B so there is now a value in Column
>B. This is a COMPLETE and EXACT match.
>
>I apologize for the length of this post and am open for clarification
>question.
>Thank you in advance.



=IF(EXACT(A2,B2),A2,"")


--ron
 
Reply With Quote
 
GVinIL
Guest
Posts: n/a
 
      26th May 2007
On May 26, 7:13 am, Ron Rosenfeld <ronrosenf...@nospam.org> wrote:
> On 26 May 2007 04:56:47 -0700, GVinIL <gronent...@visanow.com> wrote:
>
>
>
>
>
> >I am trying to create a column (column C) that contains values only
> >when the cell contents of column A and the cell contents of column B
> >are EXACT matches.

>
> >The characters in BOTH columns contain names of companies so there are
> >both alpha and numeric values.

>
> >The first FIVE characters (including spaces) of each line already
> >match EXACTLY... see example below.

>
> >I want column C to show a value only when ALL of the characters in the
> >cell in column A match EXACTLY to all of the characters in the cell in
> >column B.

>
> >I am running excel 2007 but could run an older version if needed.
> >...

>
> >The first five characters of each line are EXACT but the characters
> >after character number 5 MAY not be exact.
> >i.e.
> >Column A: Column
> >B: Column C:
> >MICROSOFT.PUBLIC.EXCEL MICROSOFT.PUBLIC.WORD
> >Able Body Labor Able Real Estate Usa, Inc.
> >ABN AMRO Abn Amro Inc.
> >Integrity Windows and Doors Integrity Windows and Doors
> >Integrity Windows and Doors
> >Central DuPage Hospital Centron Industries Inc.

>
> >As you can see in this example the first five characters of each
> >column match, but the rest of the cell characters do not match so
> >there is not a value in Column C. Except for Integrity Windows and
> >Doors. The characters in the cell in column A match EXACTLY to the
> >characters in the cell in column B so there is now a value in Column
> >B. This is a COMPLETE and EXACT match.

>
> >I apologize for the length of this post and am open for clarification
> >question.
> >Thank you in advance.

>
> =IF(EXACT(A2,B2),A2,"")
>
> --ron- Hide quoted text -
>
> - Show quoted text -


i'll be darned! It worked! Thank you!

 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      26th May 2007
On 26 May 2007 11:17:44 -0700, GVinIL <(E-Mail Removed)> wrote:


>
>i'll be darned! It worked! Thank you!


You're welcome. Glad to help.

One caveat: EXACT means exactly that. =EXACT("A","a") --> FALSE

If you want your comparison to be case-INsensitive, then use something like:

EXACT(UPPER(A1),UPPER(B1))


--ron
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      26th May 2007
or just
=a1=b1

Ron Rosenfeld wrote:
>
> On 26 May 2007 11:17:44 -0700, GVinIL <(E-Mail Removed)> wrote:
>
> >
> >i'll be darned! It worked! Thank you!

>
> You're welcome. Glad to help.
>
> One caveat: EXACT means exactly that. =EXACT("A","a") --> FALSE
>
> If you want your comparison to be case-INsensitive, then use something like:
>
> EXACT(UPPER(A1),UPPER(B1))
>
> --ron


--

Dave Peterson
 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      26th May 2007
On Sat, 26 May 2007 14:04:32 -0500, Dave Peterson <(E-Mail Removed)>
wrote:

>or just
>=a1=b1


Simpler wins, in my book :-))
--ron
 
Reply With Quote
 
Bob I
Guest
Posts: n/a
 
      31st May 2007


Ron Rosenfeld wrote:

> On Sat, 26 May 2007 14:04:32 -0500, Dave Peterson <(E-Mail Removed)>
> wrote:
>
>
>>or just
>>=a1=b1

>
>
> Simpler wins, in my book :-))
> --ron


We say "elegant solution"! ;-)

 
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
Comparing strings and characters PIEBALD Microsoft C# .NET 4 29th Aug 2008 03:46 PM
Comparing characters in one cell to multiple cells Quirthanon Microsoft Excel Worksheet Functions 1 30th Aug 2007 03:38 AM
VBA for comparing sequences of characters. a.riva@UCL Microsoft Excel Programming 11 6th Dec 2006 10:20 AM
Comparing first 5 characters Dave Redmond Microsoft Access Queries 16 27th Jun 2004 06:35 PM
comparing first characters of 2 columns ESteveP Microsoft Access Queries 2 21st Nov 2003 09:03 PM


Features
 

Advertising
 

Newsgroups
 


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