+ Reply to Thread
Results 1 to 17 of 17

Adding Multiple Results Using Vlookup

  1. #1
    Registered User
    Join Date
    07-09-2012
    Location
    Clarendon, Jamaica
    MS-Off Ver
    Excel 2010
    Posts
    8

    Adding Multiple Results Using Vlookup

    I am using Vlookup to search for staff members who have worked overtime, and return the hours worked in a summary sheet. The excel sheet is divided into months and I have created a summary sheet which has the Vlookup formula which is set up to search in the various months for the staff name and record the hours work in the summary sheet. My problem is:

    Sometimes the staff name occurs more than once e.g. Andre Stevens occurs 3x in March. However Vlookup only returns one of the results. How do I get it to add all the results and return the sum in the Summary column?
    Last edited by hawong; 07-09-2012 at 04:59 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Adding Multiple Results Using Vlookup

    You could use SUMPRODUCT for this, as this allows you to sum using multiple conditions (i.e. name = "x", month = March etc). Attach a sample workbook (the FAQ describes how) so that we can see how it would fit in to your existing data.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    07-09-2012
    Location
    Clarendon, Jamaica
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Adding Multiple Results Using Vlookup

    Yes I tried using the sum formula with the Vlookup but it didn't work for me. My current formula as it stands is:

    =VLOOKUP("Andre Stevens",March!A8:H52,8)

    How would I add in the SUM formulae to this?

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding Multiple Results Using Vlookup

    Probaly with a pivot table.

    You get better help, if you post an example.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Adding Multiple Results Using Vlookup

    It's SUMPRODUCT, not SUM. You will need to tell me which column contains the names, which column contains the dates, which column contains the hours etc. It would be easier for you to attach a sample workbook, as I requested.

    Pete

  6. #6
    Registered User
    Join Date
    07-09-2012
    Location
    Clarendon, Jamaica
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Adding Multiple Results Using Vlookup

    Yes I tried using the sum formula with the Vlookup but it didn't work for me. My current formula as it stands is:

    =VLOOKUP("Andre Stevens",March!A8:H52,8)

    How would I add in the SUM formula to this?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-09-2012
    Location
    Clarendon, Jamaica
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Adding Multiple Results Using Vlookup

    Hello, any insights?

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding Multiple Results Using Vlookup

    See worksheet total and pivot table.

    The pivot table is based on the worksheet total.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-09-2012
    Location
    Clarendon, Jamaica
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Adding Multiple Results Using Vlookup

    Hi

    The pivot table does the trick without using the formula. Thanks. R u saying that the Vlookup cannot be manipulated to give one the same results.

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Adding Multiple Results Using Vlookup

    You can put this formula in C9 of your summary sheet:

    =SUMPRODUCT(--(INDIRECT(C$8&"!A8:A100")=$A9),INDIRECT(C$8&"!H8:H100"))

    Then copy it down and across as required. Note: don't copy it beyond July (column I) until you add sheets for those later months - you will get #REF errors if you do.

    Hope this helps.

    Pete

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding Multiple Results Using Vlookup

    Vlookup won't work for you.

    Also an example with sumproduct (see month may and june).

    In the past I used indirect to get to month in the formula.

    I'm advised not to use it, because it makes the workbook slow, if it gets many calculations.

    Do you have questions, on this item, just ask.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    07-09-2012
    Location
    Clarendon, Jamaica
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Adding Multiple Results Using Vlookup

    It worked! Can you explain what it is doing? I would really appreciate it.

  13. #13
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding Multiple Results Using Vlookup

    g9
    Please Login or Register  to view this content.
    See in sheet May in the range A8:A100

    See if you find the value posted in A9 (Andre Stevens)

    If it finds Andre stevens in the range A8:A100

    Count all values (responding to Andre Stevens) in the range H8:H100

    Please reply if I explained it well enough.

  14. #14
    Registered User
    Join Date
    07-09-2012
    Location
    Clarendon, Jamaica
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Adding Multiple Results Using Vlookup

    Quote Originally Posted by oeldere View Post
    g9
    Please Login or Register  to view this content.
    See in sheet May in the range A8:A100

    See if you find the value posted in A9 (Andre Stevens)

    If it finds Andre stevens in the range A8:A100

    Count all values (responding to Andre Stevens) in the range H8:H100

    Please reply if I explained it well enough.

    Yes I believe I get you. I am going to add some more names and try the SUMPRODUCT formula. Thanks again to you and Peter.

  15. #15
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding Multiple Results Using Vlookup

    Glad I could help. Thanks for the reply.

    If the question is solved, will you mark your question as solved?

    If you have (other) questions, just ask.

  16. #16
    Registered User
    Join Date
    07-09-2012
    Location
    Clarendon, Jamaica
    MS-Off Ver
    Excel 2010
    Posts
    8

    Thumbs up Re: Adding Multiple Results Using Vlookup - Solution Received Question Solved

    Thanks Pete and Oledere. Is this how you mark it as solved?

  17. #17
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding Multiple Results Using Vlookup - Solution Received Question Solved

    To mark your thread solved do the following:
    - Go to the first post
    - Click edit
    - Click Advance
    - Just below the word "Title:" you will see a dropdown with the word No prefix.
    - Change to Solve
    - Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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