Share via

Using IF Function with Drop Down

Anonymous
2020-05-23T19:17:29+00:00

I am trying to create a spreadsheet using the If function to turn yes, no answer to numbers. 

For example column D already has data validation for a yes, no drop down option. I am trying to get column E to show different value for a yes or no option. Currently using =if(D2="Yes", 1,0)  Hope is that if I select drop down yes it will show 1 or if I pick no or if there is no value it would be zero. 

Currently with the =if(D2="Yes", 1,0) it results in a 0 appearing and does not change to 1 if yes is input in D2. As well if I add a space after "Yes " it will show 1, but wont change to 0. 

Was hoping for help or different ideas to get something similar.

Currently using Microsoft excel 2011 on Mac 

Thank you,

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-05-23T19:36:27+00:00

    Go back and look at the source of your data validation list. Instead of {"Yes", "No"} it would seem you have ("Yes ", "No "} (note trailing space(s)). Fix that.

    Your formula could be shortened to,

    =--(D2="Yes")

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments