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 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