+ Reply to Thread
Results 1 to 5 of 5

Compare numbers and add to total

  1. #1
    Registered User
    Join Date
    10-07-2013
    Location
    cardiff wales
    MS-Off Ver
    Excel 2010
    Posts
    8

    Compare numbers and add to total

    Hello,

    I would very much appreciate it if someone could find a solution to this problem.
    In my dummy workbook in sheet2 i want to compare numbers in cols C & F
    if col C is larger than col F number then the player in the matching col gets 1 point added to col D on sheet3.
    and the player whose number is lower gets minus one.It will be the same if col F is larger than col C.


    see attached for dummy data.

    Thanks.
    Attached Files Attached Files
    Last edited by bewise; 10-21-2013 at 02:42 PM.

  2. #2
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: Compare numbers and add to total

    This should do the trick. Run the macro Comp_Cols. If there is a tie, no one gets/loses the 1 point
    Compare_Update.xlsm

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Compare numbers and add to total

    Hi Bewise,

    I haven't looked at hectop's solution - here's mine (since I went to the trouble, I decided to share):

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.

    Open a macro-enabled Workbook or save your Workbook As Macro-Enabled

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    And, you should be ready to go

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    Last edited by xladept; 10-20-2013 at 05:28 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    10-07-2013
    Location
    cardiff wales
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compare numbers and add to total

    Hello
    I thank you both kindly for your great codes,it is very interesting seeing two different codes doing the same job.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Compare numbers and add to total

    You're welcome

+ 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. Replies: 1
    Last Post: 04-15-2012, 09:23 AM
  2. Formula Needed to Compare Dates and return a running total
    By Cmonroe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-08-2006, 03:55 PM
  3. How do I compare two values to calculate a total?
    By lori_tig in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-18-2006, 07:35 PM
  4. VLOOKUP should compare numbers stored as text to plain numbers.
    By VLOOKUP - Numbers stored as text in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-31-2006, 12:55 PM
  5. [SOLVED] How do I compare 2 text ranges and total?
    By Kathryn J Bittman in forum Excel General
    Replies: 3
    Last Post: 12-04-2005, 04:40 PM

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