PDA

View Full Version : Calculate the percentage of those who answered YES



plakatax
03-14-2016, 08:18 AM
Hi Everyone,


I would like to seek for your help in getting the percentage of people who answered yes. Let's say on below table, 80% answered Yes. i would like also to know the breakdown of the respondents. Like how many (in perecentage) from the respondents came from US, germany, China etc.


i would like to have a button to click then a message box will appear containing the percentages.




Please help.


Thanks,
Mike

ctutka
03-14-2016, 08:25 AM
For calculating how many answers are yes you can just use an IF statement to see if Range("D?") = Yes then increment a counter variable each time it is true. Also increment a total variable each time regardless. Then CounterYes / CounterTotal * 100 = YesPct.

Will this always have the same number of entries or will it vary? I.e. always 10 names or sometimes 12 or 15 or w/e?

Paul_Hossler
03-14-2016, 08:31 AM
I suggest using a pivot table, much easier and more flexible

15623