+ Reply to Thread
Results 1 to 6 of 6

Removing Candidates iteratively From a Ballot

  1. #1
    Registered User
    Join Date
    04-26-2015
    Location
    London,England
    MS-Off Ver
    2011
    Posts
    2

    Removing Candidates iteratively From a Ballot

    Hello all,

    I am having with the following problem:

    Suppose you have a Voting ballot below,

    Voter 1 Voter 2 Voter 3 Voter 4
    Obama Gore Bush Obama
    Gore Clinton Clinton Gore
    Bush Obama Gore Bush
    Clinton Bush Obama Clinton



    I need to write a formula that looks at row 4 and eliminates the presidential candidate with the most votes in that row. Then, move up to row 3 and take out the candidate in that row that shows up the most. Do the same with Row 2 and then we are left, by process of elimination, with an election winner.


    I can do all the rows individually, but am having trouble having them vary off eachother, meaning that if Obama is eliminated in row 4, Row 3 doesn't even search for Obama. Anybody have any tips?
    Last edited by marcus1991; 04-26-2015 at 10:17 PM.

  2. #2
    Forum Expert sandy666's Avatar
    Join Date
    02-05-2015
    Location
    Any Country
    MS-Off Ver
    farerwell
    Posts
    8,749

    Re: Help with Simple Problem

    first change title before moderator catch you

    http://www.excelforum.com/forum-rule...rum-rules.html
    sandy
    How to create an editor for Power Query with Notepad++ (tutorial)
    How to create timeline project with vertical today marker (2010, 2013, 2016 etc...) (examples)
    Tips for Excellent Spreadsheets

    What makes learning so hard is the amount of knowledge you have to unlearn
    Why is my program not doing what I expect?
    Because you set the wrong expectations. Rewire your brain

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16/365
    Posts
    51,883

    Re: Help with Simple Problem

    Hi, welcome to the forum

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... based in Ireland... but I could be anywhere in the world
    MS-Off Ver
    Office 365 for PC.
    Posts
    33,979

    Re: Removing Candidates iteratively From a Ballot

    I think that you eed to explain this a bit better... From what you have said: "eliminates the presidential candidate with the most votes in that row."

    That means in row 4, you want to eliminate Clinton (2 votes). then in row 3, no Clinton, no problem and Bush goes. Then in row 2 ignore Clinton & select Gore. Then in Row 1, Bush & Gore go, leaving Obama. Is that what you wanted?
    Glenn



  5. #5
    Registered User
    Join Date
    04-26-2015
    Location
    London,England
    MS-Off Ver
    2011
    Posts
    2

    Re: Removing Candidates iteratively From a Ballot

    Glenn,

    That is exactly it! I am still having trouble on this problem!

    Thanks

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... based in Ireland... but I could be anywhere in the world
    MS-Off Ver
    Office 365 for PC.
    Posts
    33,979

    Re: Removing Candidates iteratively From a Ballot

    I'll bet you thought that I had forgotten about you? Fear not.. not quite, it just took me a while to get my head round this. It's actually not that difficult. the only odd thing is that the formula starts at the bottom and must be dragged UP the column.

    Also, these are Array Formulas. These are Array Formulas. They're a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...

    try it out & tell me if it breaks.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. My problem is simple - no - it's me that's simple...
    By Glenn Kennedy in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 07-08-2012, 02:20 PM
  2. [SOLVED] Simple problem im sure....
    By euanhampton in forum Excel General
    Replies: 2
    Last Post: 05-03-2012, 10:59 AM
  3. Simple IF problem
    By abhijit786 in forum Excel General
    Replies: 3
    Last Post: 06-24-2011, 12:10 AM
  4. Simple (I think) problem
    By Aussie_Striker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-22-2006, 08:26 AM
  5. Simple Problem - Please Help
    By mpeplow in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2006, 02:12 PM

Tags for this Thread

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