+ Reply to Thread
Results 1 to 3 of 3

LOOP QUESTION to add the same data in one column but names aren't quite spelled the same

  1. #1
    Forum Contributor
    Join Date
    03-14-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    491

    LOOP QUESTION to add the same data in one column but names aren't quite spelled the same

    I would like to take it a bit further please with the whole nested loop question.

    This is from a prior thread but I wish to expand on one idea. So sorry for the re-post.

    Lets say the same players name is listed multiple times in the sheet (See my attachment)

    I want Excel to loop through just that same player name but recognize when the name is not written out exactly the same (ie lower case, spacing)

    each time there is a re-occurrence of the name I need the total points in the corresponding points column to be added (results of just the player name and his points copied to sheet 2 once).

    I've done research and I found something called match case and wild card...would that apply here? Or should I be thinking of the word "fuzzy"???


    But how will I ensure excel recognizes that two items in a particular cell are the same and THEN know when there is a new Name that is being referenced. For instance, when it jumps to the next players name (which is different all together),
    Can excel differentiate this?

    For example in my attached sheet...my macro would loop through the name Kevin Durant (which is presented different in the first few rows of column B and add the 28.3 from the points column; hence "28.3" should be added 3 times .....
    Next...
    paste "Kevin Durant" on sheet 2 with the total of points (the result of 28.3 added three times).

    Then the Macro should do the same for Carmelo Anthony etc...

    With the loops provided above I'm sure I can figure it out but my whole deal is getting around the names that don't
    match/in addition to jumping to the next new name.

    Any help would be greatly appreciated...I've become a Macro maniac and am eager to understand this approach/solution.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: LOOP QUESTION to add the same data in one column but names aren't quite spelled the sa

    Looking at your example data, you may be able to use ucase and replace functions to test, for example:
    Please Login or Register  to view this content.
    you could probably even do:
    =SUM(IF(UPPER(SUBSTITUTE(B$2:B$16," ",""))=UPPER(SUBSTITUTE(B2," ","")),F$2:F$16,0))
    as an array formula (confirm with ctrl+shift+enter) in M2 and copy down to return total points for each player.

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    491

    Re: LOOP QUESTION to add the same data in one column but names aren't quite spelled the sa

    Quote Originally Posted by yudlugar View Post
    Looking at your example data, you may be able to use ucase and replace functions to test, for example:
    Please Login or Register  to view this content.
    you could probably even do:
    =SUM(IF(UPPER(SUBSTITUTE(B$2:B$16," ",""))=UPPER(SUBSTITUTE(B2," ","")),F$2:F$16,0))
    as an array formula (confirm with ctrl+shift+enter) in M2 and copy down to return total points for each player.
    Thank You For your response.

+ 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. [SOLVED] Macro to Turn Data Into Table (Column Shade Aren't Uniform)
    By Gard5096 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-11-2013, 03:30 PM
  2. Loop to search specific names in column and delete other rows
    By EJ_2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2013, 01:28 PM
  3. Replies: 1
    Last Post: 09-03-2012, 10:52 PM
  4. Replies: 3
    Last Post: 03-04-2010, 04:12 AM
  5. Replies: 2
    Last Post: 01-22-2010, 04:00 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