+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP Multiple re-occurring codes in the database

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    2

    VLOOKUP Multiple re-occurring codes in the database

    Hello

    I am attempting to create a cost analysis for a pro-forma for my work using VLOOKUP function. I use VLOOKUP to bring up the number of units assigned to a certain code, however my tables often have the same code multiple times and I need to add the units assigned to these codes without changing the table. VLOOKUP only brings up the first unit assigned to the lookup code. Is there any way to use a combination of SUM and VLOOKUP in order to add all the units together. Please see the attachment.

    In the attachmentm the Units column I have entered some units that I looked up myself in order to test my VLOOKUP function. The codes I am referencing are under the J column under Care HCPC. If you scroll down to row 47, code 38525 you will see that there should be 8 units showing up under column S under All Other for surgeries but only one shows up. There are eight instances of the code showing up in the table in the "Surgery All Other" tab. Is there any way to add these up without changing the table?
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: VLOOKUP Multiple re-occurring codes in the database

    have you tried =sumifs()
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: VLOOKUP Multiple re-occurring codes in the database

    Hi ehernandez,

    Martin is correct, you should use SUMIFS or just SUMIF functions.

    This is what I would use in Q3 = SUMIF('Surgery MCare'!$A$2:$A$41,D3,'Surgery MCare'!$G$2:$G$41), then use the same logic to the rest of the columns.

    You have to make sure to use the dollar signs ($) to fix your range. Without the $ signs, the range was changing too, which I don't think you want.

    Look up what the SUMIF formula and what it needs... type the formula and a helper should pop-up for more info.

    Good luck,
    Dennis

  4. #4
    Registered User
    Join Date
    11-28-2012
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: VLOOKUP Multiple re-occurring codes in the database

    Thank you for the quick response, the SUMIF function worked wonderfully .

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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