+ Reply to Thread
Results 1 to 10 of 10

Yes's and No's to 10's and 0's

  1. #1
    Registered User
    Join Date
    05-23-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2003
    Posts
    27

    Yes's and No's to 10's and 0's

    I have a column of data that has the answers "Yes" and "No" to a survey question. Im trying to sum the yes's and no's but yes should be equal to 10 and no should be equal to 0. How do I buld a formula that puts that equality in place?

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Yes's and No's to 10's and 0's

    Try something like this regular formula....
    =COUNTIF(A1:A10,"yes")*10+COUNTIF(A1:A10,"no")
    or this one...
    =SUM(COUNTIF(A1:A10,{"yes","no"})*{10,1})

    is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Yes's and No's to 10's and 0's

    Why would you sum "no" if "no" is worth 0. Wouldn't it just be:
    =COUNTIF(A1:A10,"yes")*10

  4. #4
    Registered User
    Join Date
    05-23-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Yes's and No's to 10's and 0's

    So this column is part of a worksheet with several columns of survey answers, the remainder of which are numbers...this is the only yes no column. The larger theme I'm working with is a sumproduct that pulls the numbers for a specific employee for all their surveys and retuns the total to a different cell/sheet where it is then divided by number of surveys. I dont necessarily need it to add 0 for no but would like to make them 0 to preserve continuity with all responces being numbers. I tried using an if formula as an array in a different column and got my 10' and 0's but when I plugged that column into my sumproduct formula it gave me #value and I havent been able to figure out the formatting discrepancy to make it work.

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Yes's and No's to 10's and 0's

    Quote Originally Posted by Cutter View Post
    Why would you sum "no" if "no" is worth 0. Wouldn't it just be:
    =COUNTIF(A1:A10,"yes")*10
    Hmmm...totally missed the: No=0 part, so you're right.
    I just assumed the NO answers would count for something.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Yes's and No's to 10's and 0's

    I just assumed the NO answers would count for something.
    Only in the context of "No means No".

  7. #7
    Registered User
    Join Date
    05-23-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2003
    Posts
    27
    So if i need to count yes in that column for a specific employee found in a different column (emp are in N and Y/N is in X) what would the formula be. Im looking for something like if n2:n870=*employee* then count # of yes entries in x2:x870 for that employee....

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Yes's and No's to 10's and 0's

    Quote Originally Posted by bloo7997 View Post
    So if i need to count yes in that column for a specific employee found in a different column (emp are in N and Y/N is in X) what would the formula be. Im looking for something like if n2:n870=*employee* then count # of yes entries in x2:x870 for that employee....
    In order to avoid a cycle of "Oh, one more thing"...Are there any other sleeper requirements that might pop up as we go along? We can offer better help when we know all of the circumstances.

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,450

    Re: Yes's and No's to 10's and 0's

    Quote Originally Posted by Ron Coderre View Post
    ...Are there any other sleeper requirements ...
    Nice expression !

  10. #10
    Registered User
    Join Date
    05-23-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2003
    Posts
    27
    I wasnt trying to make anything appear to be a "sleeper" requirement, the problem Im having relates to the yes/no issue and I figured I could deduce the rest as I've got the formula working for the remainder of the data. As i said in a previous post I've been able to use an array formula to change them to 10 and 0 in a different column but it wont sum them because of some format issue I havent been able to figure out (when I click on function help it shows them as #VALUE instead of numbers)...and I was thinking if there were some way to write a formula that just counts them and roll it into something similar to what I used on the rest of the sheet that would be good, but I'm obviously still learning and havent been able to figure that out either. I dont have the sheet with me as it is on my work computer but the formula Im using to pull the remainder of the data is along the lines of:

    =SUMPRODUCT((N2:N870=tech!Q4)*(~2:~870)) where ~ is the column containing the answers to the particular survey question I'm totaling and N is the employee column.

  11. #11
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Yes's and No's to 10's and 0's

    regarding...
    Quote Originally Posted by bloo7997 View Post
    =SUMPRODUCT((N2:N870=tech!Q4)*(~2:~870)) where ~ is the column containing the answers to the particular survey question I'm totaling and N is the employee column.
    Try this...
    =SUMPRODUCT((N2:N870=tech!Q4)*(~2:~870="Y"))

    Does that help?

  12. #12
    Registered User
    Join Date
    05-23-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Yes's and No's to 10's and 0's

    That worked grat! Thank you

  13. #13
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Yes's and No's to 10's and 0's

    Quote Originally Posted by bloo7997 View Post
    That worked grat! Thank you
    Glad I could help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1