mercredi 9 septembre 2015

Get a yes, no, or nothing out of a cell in Excel

Im trying to get either a Yes, No or nothing out of a cell in excel.

If i try the code below it will print "Yes" or " " but it will not print "No"

=IFERROR(IF(SEARCH("Y",F3),"Yes",IF(SEARCH("n",F3),"No","")),"")

cell F3 has

Y - D3

or

N - D3

It works fine with the following code, but it won't search for the string

=IFERROR(IF(F3="Y","Yes",IF(F3="N","No","")),"")

"N" and "Y" work but "Y - D3" doesn't

Any comments are appreciated

Aucun commentaire:

Enregistrer un commentaire