+ Reply to Thread
Results 1 to 5 of 5

Yes No formula returning % help.

  1. #1
    Forum Contributor
    Join Date
    08-03-2005
    Posts
    269

    Yes No formula returning % help.

    How would you do this. I have a column, C, that has a bunch of names in it say Apple, Orange, Bananna. I want to write a formula that tells me for all the Apples in column C what percent of "yes" answers do I have to a yes/no question in column E. I am using y and n in column E. Do I need to use Vlookups? How would I do that?

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    To get the total number of "Apple"s in C with "Y" in E

    =SUMPRODUCT(--(C1:C100="Apple"),--(E1:E100="Y")

    to get a percentage of "Apple" with "Y" out of the total number of "Apple"s...

    =SUMPRODUCT(--(C1:C100="Apple"),--(E1:E100="Y")/COUNTIF(C1:C100,"Apple")

    or an array formula to do the same

    =AVERAGE(IF(C1:C100="Apple",IF(E1:E100="Y",1,0)))

    confirm with CTRL+SHIFT+ENTER

    in all cases format as percentage and adjust ranges as necessary

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Does this help

    =SUMPRODUCT(--(C2:C100="Apple")*(E2:E100="Yes"))/COUNTA(C2:C100)

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    pinmaster
    Guest
    Hi,

    Maybe...

    =100/(SUM(IF(C1:C10="apple",1))/SUM(IF((C1:C10="apple")*(E1:E10="y"),1)))

    enter as an array using....CTRL+SHIFT+ENTER


    Hope this helps!
    Jean-Guy

  5. #5
    Forum Contributor
    Join Date
    08-03-2005
    Posts
    269
    thanks guys, very helpful!!

+ 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