Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IF question 2

Status
Not open for further replies.

mimi2

Technical User
Apr 2, 2002
407
CA
Hello, i know it is simple, but i can't get it to work!!!!
I have a file like this:
XX XX 1
XX YY 15

i need to count the number of correct and incorrect answers.
for that purpose, i am addind two columns "correct" and "incorrect"

for instance, for the first lign XX=XX then i have 1 on the correct column and 0 on the incorrect column.
for the 2sd row, 0 in the correct column and 15 in the incorrect one.
I tried something like
=IF(A1=B1,C1,0)but i get wrong answers!!

thanks for any help.
 
You will need to do a formula in both column C and D

=IF(A1=B1,1,0) 'in column C for equal

=IF(A1=B1,0,1) 'in column D for not equal
 
I suspect that the text is dirty with leading or trailing characters,

try this...


=IF(TRIM(A1)=TRIM(B1),TRIM(C1),0)
 
thanks a lot. the trim trick made it work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top