+ Reply to Thread
Results 1 to 10 of 10

Sum Values Based on Criteria

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Question Sum Values Based on Criteria

    Hello Team,

    Need your expert help in creating a macro to the below sum up the values with below criteria.

    I have set of data which I work on monthly basis. In my scenario there are a list of customers and I need to sum up amount due from customer for the month. However there are a few customers with head office and branches and I want to see the total amount due (roll up amount due from branches with head office of a given customer) under the head office irrespective of the number of branches they have.

    My data : Sheet 1: Column A has a unique customer ID which is generated irrespective of head office or branch. Column B has the Customer's legal name & Column C has amount due.

    Sheet 2: Info with regards to Main office and branches of each customer

    Sheet 3: Should have the total amount due for each individual customer (should have individuals / main office only and cannot have branches.

    I have attached my test sheet for your reference.

    Thanks a lot in advance for your help

    Regards
    mohdshahtab
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Sum Values Based on Criteria

    Could we say that the Company name is always the first word in the "Cust Name"?
    So the key to search information will be this word
    In sheet2 does the customer information always in block: 1 empty row between customer
    Last edited by PCI; 12-21-2014 at 04:15 PM.
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    09-13-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum Values Based on Criteria

    Thanks PCI for your response.

    Could we say that the Company name is always the first word in the "Cust Name"?
    So the key to search information will be this word

    Unfortunately, customers branches legal names does NOT always start with the first word of head office. I apologies, I should have mentioned it earlier.
    Just a thought, can we not use the cust ID to do the search and if the ID is that of a branch then roll the amount to the respective head office.

    In sheet2 does the customer information always in block: 1 empty row between customer
    Yes, the customer information in sheet 2 is in block for reference purposes.

    Please let me know if you need any more information or have any questions.

    Thanks a lotttt again for looking into this.

    Regards,
    mohdshahtab

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Sum Values Based on Criteria

    Hi, welcome to the forum

    I fully understand the need to keep the data dummy, but it would probably help more of your dummy names/numbers were a bit closer to what you are actually working with (format/length etc).

    For instance, are the Coy/Branch numbers in any sort of sequence for a particular customer?

    In your sample data, you have...
    123450 ABC Company
    123451 XYZ company
    123452 ABC co ltd
    123453 abc partners

    which shows XYZ Cust Number inside the number sequence of the ABC customer.

    If there is a range of numbers that cover a customer, perhaps that could be used in the sum?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    09-13-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum Values Based on Criteria

    Thanks Ford for the reply.

    Customer ID is just a random number picked by the system irrespective of the main office or branch or for particular customer and is unique. Customer IDs are usually 8 digits long and can be only numeric or alpha numeric.

    Hope this clarification helps, but please do let me know if you need any further information / clarification.

    Thanks a lot again.

    Regards,
    mohdshahtab

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Sum Values Based on Criteria

    An additional question:
    "Yes, the customer information in sheet 2 is in block for reference purposes. "
    and the "customer name" and "Customer ID" to use for the Result is the first name in the block?

    Next Customer are alone and must be added in "Master Data" list
    Micky Medicals
    MK Xerox Center
    PH Stores
    PT Fitness
    Vicky Enterprises
    Last edited by PCI; 12-22-2014 at 05:47 AM.

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Sum Values Based on Criteria

    Without anymore information see attached
    Attached Files Attached Files
    Last edited by PCI; 12-22-2014 at 04:54 PM.

  8. #8
    Registered User
    Join Date
    09-13-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum Values Based on Criteria

    Thanks PCI for the file and apologies for the delay in getting back to you.

    I would require one more help on this,

    I do not want to add stand alone customers to the master data (as there are many of those) and want to keep only the data related to main office and it's branches.

    And then, would like to get the sum total only of the branches and main office in the result save tab (macro already does this). However, once the total sum amount is available in Result Save tab, I want the main office and branch office rows to get deleted from the 'Raw data' tab, so that I can copy the data from 'Result save' tab (i.e., total of amount receivable for each main branch) and paste in the last row of 'Raw data' tab.

    This means I only have data of amount receivable for each individual customer.

    Please do let me know if you need any further clarification / have any questions. I will reply to you asap.

    Regards,
    mohdshahtab

  9. #9
    Registered User
    Join Date
    09-13-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum Values Based on Criteria

    Can someone please help with the above post.

  10. #10
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Sum Values Based on Criteria

    I need additional information
    What means
    "I do not want to add stand alone customers to the master data (as there are many of those) and want to keep only the data related to main office and it's branches"
    can you give example

    "And then, would like to get the sum total only of the branches and main office in the result save tab (macro already does this). However, once the total sum amount is available in Result Save tab, I want the main office and branch office rows to get deleted from the 'Raw data' tab, so that I can copy the data from 'Result save' tab (i.e., total of amount receivable for each main branch) and paste in the last row of 'Raw data' tab"
    That means for example for "ABC Company" we have to delete in sheet "Raw Data"
    123450 ABC Company 6,161.00
    and
    123452 ABC co ltd 654.00
    and
    123453 abc partners 213.00

    and copy in
    123450 ABC Company 7,028.00
    is it?

+ 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: 4
    Last Post: 05-19-2015, 11:53 PM
  2. Sum Values based on a criteria
    By dws1982 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-02-2014, 09:09 AM
  3. [SOLVED] Count values in one list and then narrow/combine values based on criteria
    By razz0807 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2013, 08:02 AM
  4. [SOLVED] How to sum values based on multiple criteria with multple possibilities for each criteria?
    By boredaxel in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-05-2013, 02:26 AM
  5. matching values based on criteria and return values from another columns
    By lizard54 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 11:29 AM

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