+ Reply to Thread
Results 1 to 3 of 3

Finding TWO numbers from a range of numbers to match a target value

Hybrid View

  1. #1
    Registered User
    Join Date
    10-13-2014
    Location
    Finland
    MS-Off Ver
    Excel for Mac 14.4.4
    Posts
    1

    Finding TWO numbers from a range of numbers to match a target value

    I'm very new with macros and have been looking for a solution for couple of days now but I have only found very complicated ways to find ALL the possible combinations to reach the target.

    Instead I have a column of numbers, any two of which won't sum to same as another pair. I would need to write a macro that would find the pair of numbers that will sum to a target value?

    Any help would be appreciated.

  2. #2
    Registered User
    Join Date
    08-27-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Finding TWO numbers from a range of numbers to match a target value

    Based on the question... I'd write a macro.
    or
    try a funtion in a cell.
    =If(Cell1+Cell2 = TargetValue,1,0)
    or
    =if(sum(Cell1,Cell2) = TargetValue,1,0)


    An example might help.

  3. #3
    Registered User
    Join Date
    11-25-2011
    Location
    Lilydale, Victoria, Australia
    MS-Off Ver
    2013 (365)
    Posts
    63

    Re: Finding TWO numbers from a range of numbers to match a target value

    Not sure what you're after, but this might work:
    =IFERROR(INDEX($D$1:$D$7,MATCH($E$1-D1,$D$1:$D$7,0)),"")
    I listed numbers in cells D1 to D7, and the target value in E1.
    The formula, which I put in cells F1 to F7 (changing D1, D2...), calculates the value of the target minus the values in each cell in the list (E1-D1, E1-D2, etc), then uses INDEX and MATCH to look for the result in the list.
    I also put an IFERROR check in there, to avoid errors showing when the result was not found.
    Successful values show in cells in column F, beside the number in column D which it adds to to get the target number.
    Last edited by GCW esq; 10-18-2014 at 11:42 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. Replies: 4
    Last Post: 05-08-2014, 09:43 PM
  2. Replies: 0
    Last Post: 01-29-2012, 10:05 PM
  3. Finding the sum within a range of numbers
    By johnbeckman in forum Excel General
    Replies: 11
    Last Post: 12-31-2008, 12:41 AM
  4. finding range of numbers in a column
    By langdon37 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-03-2008, 05:29 PM
  5. Replies: 5
    Last Post: 01-19-2006, 07:30 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