• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need help with if text formula

Linda Crasco

New Member
I am trying to enter a formula that will look at two cells, and if one of the cells has a text value (either one or none of the cells has text; in no instance does both cells have text), return that text, and if both are blank return nothing. The cells are not adjacant.

Assuming the two cells I am looking at are C2 and F2 I've tried:

=IF(ISBLANK(C2),F2,C2).
=IF(ISBLANK(C2),IF(ISBLANK(F2)," ",F2),C2)

Both formulas returns the text in C2, but ignores the text in F2, returning a blank for either text in F2, or no text in both C2 and F2.

Does anyone have any suggestions?

Thanks!
~Linda
 
Hi Linda ,

From what you have posted , I suspect that what you think is a blank cell is not really blank. If we take the first formula you have posted :

=IF(ISBLANK(C2),F2,C2)

This is a perfectly valid and straightforward formula ; all it says is that if C2 is blank , then return the value in F2 ; if C2 is not blank return the value in C2.

Thus , if you are saying that when you see C2 is blank , and F2 has text , the formula still returns a blank , it can only mean that C2 is not blank.

Do C2 and F2 get their contents through a formula ? If yes , then it is possible the formula is using "" as the output ; this is not the same as a blank cell.

Thus , instead of using the ISBLANK function , try this :

=IF(AND(C2="",F2=""),"",IF(C2<>"",C2,F2))

or

=IF(AND(C2=" ",F2=" "),"",IF(C2<>" ",C2,F2))

The second version should normally not be used , since you should not introduce a single blank to display a blank cell ; even "" will work.

Narayan
 
Thank you both! I had the same problem in two different files; one had a formula returning " ", so I ended up using both solutions.

~Linda
 
Back
Top