MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Comparing Cells with Text


Posted by Razzie on January 15, 2002 2:44 PM

What formula can I use to compare two cells and then return a value? For example, I the following results based on these comparisons:
1. IF Sheet1!A3 has text AND if Sheet2!B4 has text, return "no value".

2. IF Sheet1!A3 has text AND if Sheet2!B4 has value, return the value for Sheet2!B4

3. IF Sheet1!A3 has value AND if Sheet2!B4 has text, return the value for Sheet1!A3

4, IF Sheet1!A3 has value AND if Sheet2!B4 has value return the sum of the values.


Posted by Nate Oliver on January 15, 2002 2:57 PM

=IF(AND(ISTEXT(Sheet1!A3)=FALSE,ISTEXT(Sheet2!B4)=FALSE),+Sheet1!A3+Sheet2!B4,IF(AND(ISTEXT(Sheet1!A3)=TRUE,ISTEXT(Sheet2!B4)=TRUE),"no value",IF(ISTEXT(Sheet1!A3)=TRUE,Sheet2!B4,Sheet1!A3)))

Posted by Razzie on January 15, 2002 3:06 PM

Thanks. You are awesome. I never expected such a quick answer.


Posted by Nate Oliver on January 15, 2002 3:14 PM

Funny, a young lady said the same thing to me the other night.

Cheers, Nate