Hi everyone! I'd like to build a formula in Excel sheet in the way that there is a cell where I would type Y (for Yes) or N (for NO) and depending on what is put in this cell some calculation should be done or not.

In other words : IF (cell_XY=Y/N;some_action)

I have built and use currently some similar formulas with numbers but never with letters as condition.Could someone tell me the syntax for this?

Thnx a lot in advance!!

:-)Zennon

Hi, If cell A1 contains your Y or N letter,

then in another cell enter this formula:

=IF(A1="Y","Your cell says Yes","Your cell says No")This formula depends on the assumption that cell A1

onlyever contains Y or N.You can extend the formula like this:

=IF(A1="Y","Your cell says Yes",IF(A1="N", "Your cell says No","This looks like a maybe"))

and the formula will respond to three states - Y, N or anything else.If you want to be sure that cell A1 contains

onlyY or N look at Data Validation with the List option, and you can stop anything other than Y and N being entered.

(although data validation is not case sensitive) - so the formula to use should allow both upper and lower case, like this:

=IF(OR(A1="Y",A1="y"),"Your cell says Yes","Your cell says No")If you go the data validation route and need more help - just ask.

Regards

Maybe I'm missing something, but I didn't think that an IF statement was case sensitive. Either of these should work for A1 = Y or A1 = y:

=IF(A1="Y", "Your cell says Yes", "Your cell says No")

=IF(A1="y", "Your cell says Yes", "Your cell says No")Another option for Data Validation, if you you don't want a Drop Down, is to use Custom with the following formula:

=IF(OR(A1="Y",A1="N"), TRUE, FALSE)

In this case, you would want to enter a message in the Error Alert tab to let the user know what entries are acceptable.

Hi DerbyDad03, Thanks,

The formula (used with data validation) can be my first suggestion:

=IF(A1="Y","Your cell says Yes","Your cell says No")Regards

Thanks a lot to all of you for quick help!Have a nice day!

Zennon

Ask Your Question

Weekly Poll

Is Amazon Prime same day delivery available where you live?

Discuss in The Lounge

Poll History