Consulting

Results 1 to 2 of 2

Thread: VLOOKUP with a SUM

  1. #1
    VBAX Regular
    Joined
    Jun 2014
    Posts
    7
    Location

    VLOOKUP with a SUM

    Hello all,

    When you have data in a table like this:

    Child
    Group
    # Correct
    # Incorrect
    James Group 1 5 5 Group 1 Total Correct: x
    Sarah Group 2 8 2 Group 1 Total Incorrect:
    Carter Group 2 7 3 Group 2 Total Correct:
    Tim Group1 3 7 Group 2 Total Incorrect:
    Cristy Group 1 8 2
    Cynthia Group 2 6 4

    So where the x is, I would like to figure out: Where Column 2 cells = Group 1, add how many are in the corresponding "# Correct " column. I'm assuming use a Vlookup("Group 1", B2: D7, 2, FALSE), but I need to throw a SUM function in there somehow and not quite sure where. Can someone point me in the right direction? I know it has to be fairly simple, but for some reason I can't follow the logic today lol

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    Hi.

    You want to sum values based on one condition. So use sumif function.
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •