Solved Yes/No choice in Excel sheet

April 19, 2010 at 05:38:28
Specs: Windows XP, 2096
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


See More: Yes/No choice in Excel sheet

Report •


#1
April 19, 2010 at 05:54:12
✔ Best Answer
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 only ever 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 only Y 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


Report •

#2
April 19, 2010 at 06:25:32
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.


Report •

#3
April 19, 2010 at 07:40:54
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


Report •

Related Solutions

#4
April 19, 2010 at 10:32:20

Thanks a lot to all of you for quick help!

Have a nice day!


Zennon


Report •


Ask Question