+ Reply to Thread
Results 1 to 4 of 4

Sum target number

  1. #1
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Sum target number

    Hello All!

    I have doing some reading on this, and it appears there is no easy way. But I figured I would see if anyone here has come up with a solution.

    Issue: I would like a macro, which would allow the end user to enter a value, then based on that value entered; find a series of values in a specified row which would either come close or match that value. Remove those associated rows, and place them into a new spreadsheet.

    Ideally not using Excel Solver.

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,676

    Re: Sum target number

    One way:

    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    30
    7
    1
    9
    7
    0
    5
    1
    B1:H1: {=RandLen(A1)}
    2
    25
    1
    6
    4
    3
    1
    1
    9


    Here's the UDF:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Sum target number

    Wow, very nice. Probably a stupid question. But I have never called a function before in Excel. How would I go about calling this function?

    Thanks,

    Lonney

  4. #4
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,676

    Re: Sum target number

    In the example, select B1:H1, paste =RandLen(A1) in the formula bar, press and hold the Ctrl and Shift keys, then press Enter.

+ 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] How to add six number sets, from 1 to 54-- target = 130 to 140
    By dwetexas in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-22-2014, 04:36 PM
  2. [SOLVED] divide a number closest to a target
    By koi in forum Excel General
    Replies: 3
    Last Post: 12-22-2012, 12:59 PM
  3. Percentage chance to hit target number
    By miinstrel in forum Excel General
    Replies: 3
    Last Post: 04-09-2011, 06:52 PM
  4. Target.Value - Must be a number
    By Desert Piranha in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2006, 08:26 PM
  5. Building to a target number
    By uship in forum Excel General
    Replies: 1
    Last Post: 08-07-2006, 08:45 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