Excel IF Formula to Assign Scores to Yes or No Responses
Question details
Assign a score to a Yes or No response using an Excel formula.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains responses and separate cells for the criterion and scores.
- Observed behavior
- The formula should return the Yes score when the response matches the criterion and the alternative score otherwise.
Identify the response cell, the cell containing the Yes criterion, and the cells containing the Yes and No scores. In the example below, these are B1, B9, C9, and E9 respectively.
Use an IF formula to assign the response score
Compare the response with a Yes criterion and return the corresponding score.
In Excel, enter Yes in B9, the Yes score in C9, and the No score in E9. Enter the response in B1.
Select an empty score cell and enter =IF(B1=B9,C9,E9), then press Enter.
Drag the score cell's fill handle to copy the formula to other questions. Check and adjust the references if each question uses different criterion or score cells.

Assign Yes or No Scores in WPS Spreadsheets
Use the IF function in WPS Spreadsheets to compare a response with a criterion and return the appropriate score.
- 1. Open your worksheet: Open WPS Spreadsheets and select your worksheet, or create a new spreadsheet.
- 2. Enter the response and scores: Enter a response in B1, Yes in B9, the Yes score in C9, and the No score in E9.
- 3. Add the IF formula: Select an empty score cell, enter =IF(B1=$B$9,$C$9,$E$9), and press Enter.
- 4. Fill additional rows: Drag the formula cell's fill handle down to score responses in subsequent rows, keeping the criterion and score cells fixed.

Frequently Asked Questions
How do I give Yes a score of 1 and No a score of 0?
If the response is in B1, enter =IF(B1="Yes",1,0) in an empty cell. This also returns 0 for blank cells or any other response.
How can I keep the score cells fixed when copying the formula?
Use absolute references for the shared criterion and score cells: =IF(B1=$B$9,$C$9,$E$9). Then drag the formula cell's fill handle down.
Can the No response return a score other than zero?
Yes. Enter the desired No score in E9 and use =IF(B1=B9,C9,E9). The formula returns E9 whenever the response does not match B9.
How can I leave the score blank when the response cell is blank?
Use =IF(B1="","",IF(B1=$B$9,$C$9,$E$9)) in the score cell. A blank B1 produces a blank result; other nonmatching responses still receive the score in E9.




