1,575 articles and 11,602 comments as of Sunday, June 6th, 2010

Thursday, November 29, 2007

How can I tally individual votes when the SharePoint survey combines multiple choice selections as a single vote?

Today’s question comes from Linda and Yongwei in Shanghai:

“Is there a way we can have people vote on SharePoint to accomplish the following? We will provide a list of 10 candidates. The user is supposed to vote for no more than 3 of them by checking the box. We need a tally by each candidate at the end. The problem with our first implementation, using a survey, is it counts by the combination of the three votes. For example, if one person votes for 1,2,3, and the other votes for 2,3,4. The final tally says one vote for 1+2+3, one vote for 2+3+4, what we want is 2 votes each for 2,3 and 1 vote each for 1 and 4.


“What I want is something like this:

Bill = 1
Barbara = 2
Cathy = 1

“Here is screen shot. Is there any way to see for each choice how many people have selected it?”


After looking at it for a second, I started thinking about possible ways to do this, other than using a survey. What I suggested they do is create a customized list using each candidate name as a column and then use the count functionality built into the view of the list. Here’s a quick screencast to give you the idea. Let me know what you think.

 

Please Join the Discussion

8 Responses to “How can I tally individual votes when the SharePoint survey combines multiple choice selections as a single vote?”
  1. Janis Hall says:

    Great tips! I plan to reference your blogs to my students :)

  2. Mark Miller says:

    Thanks, Janis. I’ve also done the same regarding your post on when to create libraries. Let’s keep in touch.

    Mark

  3. Heath Castle says:

    I have been looking into this for hours. Excellent workaround. Thanks.

  4. Joseph says:

    I have a poll question with 100+ choices. When creating a Survey I can copy and paste the choices from a spreadsheet. With the workaround, I don’t want to manually create the columns one by one. Is there an easy way to do that in batch?

  5. Joseph – Move your question to Stump the Panel and it will get more exposure. This thread is almost a year old.

    Regards,
    Mark

  6. Sachin says:

    Hi

    My survey is having more than one multiple choice questions. Here you suggested to create a custom list for one question. So far more than one questions, should we extrapolate this approach? Should we create one custom list per question?

  7. surendra singh says:

    Hi,

    How to Change message

    “You are not allowed to respond again to this survey. ”

    Sharepoint survey list

    Thanks
    Surendra

  8. Michael says:

    This may not be the cleanest method of reviewing results, but I have come up with an Excel macro that will break apart all questions on a survey and give you the results. All you have to do is Export to Spreadsheet your results and run this macro. I have stored the macro in my personal macros so it is always available. Below is the macro. Please let me know what you think.

    Michael Kepley

    Sub UpdateSurvey()
    
    Dim counter As Integer
    Dim row As Integer
    Dim row_answer As Integer
    Dim question As String
    Dim answer As String
    Dim answer_whole As String
    Dim answer_find As Integer
    Dim check As String
    Dim start_here As Integer
    Dim rfound As Range
    
    counter = 1
    question = Worksheets(1).Range("A1").Offset(0, counter + 1).Value
    
    Do While question  ""
    
        sheetname = "Question " + CStr(counter)
    
        On Error Resume Next
        Worksheets(sheetname).Activate
    
        If Err.Number = 0 Then
            Application.DisplayAlerts = False
            Worksheets(sheetname).Delete
            Application.DisplayAlerts = True
        End If
        On Error GoTo 0
        Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = sheetname
        Worksheets(sheetname).Range("A1").Value = Worksheets(1).Range("A1").Offset(0, counter + 1).Value
        row = 1
        row_answer = 1
        check = Worksheets(1).Range("A1").Offset(row, 0).Value
    
        Do While check  ""
    
            answer_find = 1
            start_here = 1
            answer_whole = Worksheets(1).Range("A1").Offset(row, counter + 1).Value
            Do While answer_find  0
                answer_find = InStr(start_here, answer_whole, ";#")
                If answer_find = 0 Then
                    answer = Mid(answer_whole, start_here)
                Else
                    answer = Mid(answer_whole, start_here, answer_find - start_here)
                End If
                On Error Resume Next
                Worksheets(sheetname).Columns("B:B").Select
                Set rfound = Selection.Find(What:=answer, LookIn:=xlFormulas, _
                    LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                    MatchCase:=False, SearchFormat:=False)
                If Not rfound Is Nothing Then
                    rfound.Offset(0, 1).Value = rfound.Offset(0, 1).Value + 1
                Else
                    Worksheets(sheetname).Range("A1").Offset(row_answer, 0).Value = row_answer
                    Worksheets(sheetname).Range("A1").Offset(row_answer, 1).Value = "'" + answer
                    Worksheets(sheetname).Range("A1").Offset(row_answer, 2).Value = 1
                    row_answer = row_answer + 1
                End If
                On Error GoTo 0
    
                start_here = answer_find + 2
            Loop
            row = row + 1
            check = Worksheets(1).Range("A1").Offset(row, 0).Value
    
        Loop
    
        Worksheets(sheetname).Columns("B:C").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlYes, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortTextAsNumbers
        counter = counter + 1
        question = Worksheets(1).Range("A1").Offset(0, counter + 1).Value
    
    Loop
    
    End Sub
    

Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!