+ Reply to Thread
Results 1 to 1 of 1

Lookup to return a value if a combination of items in a list equal a defined value

  1. #1
    Registered User
    Join Date
    01-31-2018
    Location
    England
    MS-Off Ver
    2017
    Posts
    1

    Lookup to return a value if a combination of items in a list equal a defined value

    I am trying to work out a way of doing a lookup whereby the formula/VBA returns a value for a given reference on sheet 1 if one or a combination of values with that reference on sheet 2 add up to a defined value with that reference on sheet 1. By way of example:

    Sheet one Sheet two
    Col A Col B Col A Col B Col C
    Reference Amount £ Reference Amount £
    12345 100 12345 20
    12346 200 12345 50 1
    12347 300 12345 50 1
    12346 200
    12347 150
    12347 150

    (See attached image for clearer formatting of the above!)

    So, in the above example I want to be able to do a lookup in sheet 1 to sheet 2 for e.g. ref 12345 where the corresponding value/values for that reference in sheet 2 sum to the given value in sheet 1. So for ref 12345 I'm trying to get a formula that confirms that a combination of the amounts for ref 12345 in sheet 2 add up to £100 (even though the total for that reference is greater than £100).

    I have worked out formula to tell me where the total for 12345 in sheet 2 is £100 but can't figure out how to show it where the total for a given reference is not equal to the target amount but a combination of items with that ref are.

    If the above is possible I would also like to be able to show on sheet 2 those items in the list that add up to the target value in sheet 1. So in the example above, I am looking for a formula/VBA that would add in the '1s' in column C indicating that these amounts equal the target £100.

    The spreadsheets I am working with have thousands of references and tens of thousands of repetitions (in sheet 2) so trying to manually match one sheet to the other isn't really an option. All suggestions gratefully received.
    Attached Images Attached Images

+ 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] Return Multiple Items with One Lookup Value
    By PMH2384 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2016, 02:42 AM
  2. [SOLVED] return FROM TO values from custom defined range , and return all possible combination
    By raj soni in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2016, 01:38 PM
  3. Equal distribution of list items with VBA
    By kingoftheace in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2015, 10:49 AM
  4. [SOLVED] lookup 2 items and return value of both
    By interested in forum Excel General
    Replies: 4
    Last Post: 08-14-2013, 04:44 AM
  5. [SOLVED] All Possible Combination From List of Items
    By shiqs28 in forum Excel General
    Replies: 1
    Last Post: 06-17-2012, 07:21 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