+ Reply to Thread
Results 1 to 8 of 8

summing individual values to match total amount

  1. #1
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    summing individual values to match total amount

    I have two sets of data. I have to find which sum of amouts in column F matches total amouts in column B, so that the z is equal to the column C. See the example.

    Is there a formula or a macro that can somehow do that? When the formula or macro finds the correct amounts, it should join them the date in column I from the column D.

    Is that possible?
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: summing individual values to match total amount

    Hi,

    Could it be any number of values from column F which sum to give the total? Or just 2?

    Perhaps you can adapt the method I give here to match your needs:

    http://excelxor.com/2014/08/26/which...d-up-to-total/

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: summing individual values to match total amount

    Yes, it can be any number, not just 2.

    I tried to copy/paste your example in my excel file but I'm not getting anything.
    Last edited by cassiopea; 08-28-2014 at 03:52 AM.

  4. #4
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: summing individual values to match total amount

    Can you please tell me why this formula does not work in my file?
    Attached Files Attached Files

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: summing individual values to match total amount

    You need to enter it as an array formula**:

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

    Regards

  6. #6
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: summing individual values to match total amount

    Thank you. It works now. What do I have to change if I want to expand range to C1:Z1?

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: summing individual values to match total amount

    Quote Originally Posted by cassiopea View Post
    Thank you. It works now. What do I have to change if I want to expand range to C1:Z1?
    Ah. Apologies. I should've mentioned that this solution is limited to a maximum of 20 values, and even then Excel will most likely fail due to the sheer size of the calculations involved.

    I ran it with 15 columns' worth, i.e. C1:Q1, and it just about made it, calculating in 5 seconds or so, though I think anything more than that will be unfeasible.

    Apologies. I didn't realise that you'd posted this in the VBA section. Clearly in your case any purely formula-based solution will not be sufficient. I will re-bump this to some colleagues who have a bit more experience in VBA than I do and hopefully someone will reply soon.

    Regards

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

    Re: summing individual values to match total amount

    Please Login or Register  to view this content.
    There is a "brute force" approach (although it works by picking random numbers, rather than cycling through possibilities). You could probably code a bit more intelligence/optimisation into the routine but it would do for a starting point I guess.
    Last edited by ragulduy; 08-28-2014 at 07:17 AM.

+ 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] Index match or Data Validation to get the total amount
    By pamela16 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-07-2014, 08:55 AM
  2. Index match or Data Validation to get the total amount
    By pamela16 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-07-2014, 07:41 AM
  3. Replies: 1
    Last Post: 09-07-2011, 01:19 PM
  4. Summing values from different dates for monthly total
    By HP RodNuclear in forum Excel General
    Replies: 1
    Last Post: 01-21-2011, 11:32 AM
  5. Replies: 1
    Last Post: 08-29-2010, 10:51 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