ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Logical operators not working with text??? (https://www.excelbanter.com/excel-worksheet-functions/232146-logical-operators-not-working-text.html)

Slinky[_2_]

Logical operators not working with text???
 
For some reason my comparison operators aren't working in my
spreadsheets and I can't figure out why. I think this worked on
another PC. What I want to do is have a row that increments a value if
the entries are the same - really simple - Lets assume all the values
in the A row are below:

A B
1 - TTTT 0
2 - TTUU Formula Below
3 - TTUU
4 - VVVV
5 - WWW
6 - WWW

In the B row I set B1 to zero and then type the following in cell 2:

=IF(A2=A1,B1+0,B1+1)

So if A2 (TTUU) is equivalent to A1 (TTTT) then don't increment, if
it's false then it's a new record so increment. The result is that the
above should put out the following in the B row - 0, 1, 1, 2, 3, 3. It
works on the first statement and everything else stays the same - 0,
1, 1, 1, 1, 1, 1, 1..

=IF(A11=A10,(B10+0),(B10+1))

Even putting the addition in parenthesis doesn't change the effect.

=IF(G2<G1,"A","B")

This always yields "A" no matter what values are in the G column. It
increments the first time and never does again. What is wrong?


Harlan Grove[_2_]

Logical operators not working with text???
 
Slinky <slinky_ISAT_newsguy_DOT-com wrote...
....
in the A row are below:

* * * * A * * * B
1 - * * *TTTT * *0
2 - * * TTUU * * Formula Below
3 - * * TTUU
4 - * * VVVV
5 - * * WWW
6 - * * WWW

In the B row I set B1 to zero and then type the following in cell 2:

=IF(A2=A1,B1+0,B1+1)

....

A and B are COLUMNS, not rows.

. . . the
above should put out the following in the B row - 0, 1, 1, 2, 3, 3. It
works on the first statement and everything else stays the same - 0,
1, 1, 1, 1, 1, 1, 1..


Press the [F9] key. The situation you describe is very likely due to
manual recalculation.

Niek Otten

Logical operators not working with text???
 
There may be invisible characters in one of the cells. Simplest is spaces,
but there may be others.
You can test with the LEN() function.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Slinky" <slinky_ISAT_newsguy_DOT-com wrote in message
...
For some reason my comparison operators aren't working in my
spreadsheets and I can't figure out why. I think this worked on
another PC. What I want to do is have a row that increments a value if
the entries are the same - really simple - Lets assume all the values
in the A row are below:

A B
1 - TTTT 0
2 - TTUU Formula Below
3 - TTUU
4 - VVVV
5 - WWW
6 - WWW

In the B row I set B1 to zero and then type the following in cell 2:

=IF(A2=A1,B1+0,B1+1)

So if A2 (TTUU) is equivalent to A1 (TTTT) then don't increment, if
it's false then it's a new record so increment. The result is that the
above should put out the following in the B row - 0, 1, 1, 2, 3, 3. It
works on the first statement and everything else stays the same - 0,
1, 1, 1, 1, 1, 1, 1..

=IF(A11=A10,(B10+0),(B10+1))

Even putting the addition in parenthesis doesn't change the effect.

=IF(G2<G1,"A","B")

This always yields "A" no matter what values are in the G column. It
increments the first time and never does again. What is wrong?



Slinky[_2_]

Logical operators not working with text???
 
On Wed, 27 May 2009 12:57:36 -0700 (PDT), Harlan Grove
wrote:

Slinky <slinky_ISAT_newsguy_DOT-com wrote...
...
in the A row are below:

* * * * A * * * B
1 - * * *TTTT * *0
2 - * * TTUU * * Formula Below
3 - * * TTUU
4 - * * VVVV
5 - * * WWW
6 - * * WWW

In the B row I set B1 to zero and then type the following in cell 2:

=IF(A2=A1,B1+0,B1+1)

...

A and B are COLUMNS, not rows.

. . . the
above should put out the following in the B row - 0, 1, 1, 2, 3, 3. It
works on the first statement and everything else stays the same - 0,
1, 1, 1, 1, 1, 1, 1..


Press the [F9] key. The situation you describe is very likely due to
manual recalculation.


SUPER!!!! Thanks - that was the problem. Thanks for the answer and the
syntax (yep... I was so frustrated... they are columns! :) )


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com