Excel "IF" Formula Help?

I need a formula that calculates if there is text in A1&B1 than C1=2
If there is only text in A1 than C1= 1.

Any help you could provide is appreciated. Thanks!

mti29352009-06-24T10:48:03Z

Favorite Answer

this formula in cell C1 should do the trick:

=IF(LEN(A1)>0,1,0) + IF(LEN(B1)>0,1,0)

Anonymous2009-06-24T10:46:51Z

so my question what if B1 has a number...that isn't text...
I need to know if you mean blank, instead of no text

try this

=IF(OR(A1="",B1=""),"1","2")

through the rain2009-06-24T10:50:19Z

=counta(a1:b1)-count(a1:b1)

tarkesh m2009-06-24T10:49:17Z

=IF(A1<>"",IF(B1<>"",2,1), 0)

0 is like both null..