Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike K
 
Posts: n/a
Default Compare two cells from reference cells

Oh wise ones,
I have two cells that I am comparing. The values come from an array
function that is pulled from a sql server, so the reference cells are not
very editable. Lets call them A1 and A2. I refer to them in B1 and B2 where I
compare them for equality. They look identical, but they do not compare as
true so there must be some leading/trailing spaces. How can I take out the
spaces from B1 and B2 so they compare properly?

Thanks,
Mike
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bpeltzer
 
Posts: n/a
Default Compare two cells from reference cells

TRIM will removing leading and trailing spaces. Another common cause of
failure to match is a difference between a number (123) and a string
representation of that number ("123"). TRIM will also convert the number to
its equivalent string; VALUE will convert a string of digits to its numeric
equivalent.

"Mike K" wrote:

Oh wise ones,
I have two cells that I am comparing. The values come from an array
function that is pulled from a sql server, so the reference cells are not
very editable. Lets call them A1 and A2. I refer to them in B1 and B2 where I
compare them for equality. They look identical, but they do not compare as
true so there must be some leading/trailing spaces. How can I take out the
spaces from B1 and B2 so they compare properly?

Thanks,
Mike

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike K
 
Posts: n/a
Default Compare two cells from reference cells

Thanks, that works beautifully. I forgot about the TRIM function. I've never
had to use it before, but I knew there was something like that to suit my
purpose. They sometimes tinker with the PLC tags, and what was working one
day, may not be the next. Then it's up to me to fix my app- again.

Thanks again,
Mike

"bpeltzer" wrote:

TRIM will removing leading and trailing spaces. Another common cause of
failure to match is a difference between a number (123) and a string
representation of that number ("123"). TRIM will also convert the number to
its equivalent string; VALUE will convert a string of digits to its numeric
equivalent.

"Mike K" wrote:

Oh wise ones,
I have two cells that I am comparing. The values come from an array
function that is pulled from a sql server, so the reference cells are not
very editable. Lets call them A1 and A2. I refer to them in B1 and B2 where I
compare them for equality. They look identical, but they do not compare as
true so there must be some leading/trailing spaces. How can I take out the
spaces from B1 and B2 so they compare properly?

Thanks,
Mike

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
Excel should be able to map which cells reference each other. URCHE Excel Worksheet Functions 1 October 11th 05 03:23 AM
Compare data - one cell to multiple cells srs710 Excel Discussion (Misc queries) 1 July 20th 05 11:43 AM
How can I autofill a series to reference non adjacent cells? Microcell Excel Discussion (Misc queries) 1 June 30th 05 09:49 PM
changing multiple cells from relative to absolute reference Mike Excel Discussion (Misc queries) 4 March 10th 05 02:11 PM
Using the results from two seperate cells to create cell reference DarrenWood Excel Worksheet Functions 0 November 14th 04 10:20 PM


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