Logical operators not working with text???

  • Thread starter Thread starter Slinky
  • Start date Start date
S

Slinky

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 said:
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.
 
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.
 
Slinky said:
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! :) )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top