Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel should be able to map which cells reference each other. | Excel Worksheet Functions | |||
Compare data - one cell to multiple cells | Excel Discussion (Misc queries) | |||
How can I autofill a series to reference non adjacent cells? | Excel Discussion (Misc queries) | |||
changing multiple cells from relative to absolute reference | Excel Discussion (Misc queries) | |||
Using the results from two seperate cells to create cell reference | Excel Worksheet Functions |