+ Reply to Thread
Results 1 to 6 of 6

Generating numeric values in multiple cells using a single cell as reference.

  1. #1
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    69

    Generating numeric values in multiple cells using a single cell as reference.

    I have a excel sheet which has 9 columns as below:
    Untitled.png
    How do I generate random numeric values (0 decimal place) in columns Part-1 to Part-8 where the sum of the values of columns Part-1 to Part-8 is equal to its equivalent Total column value ??
    In short, the output excel file should look something like this:
    Untitled2.png
    How do I do this?
    Is it even possible using built-in excel functions?

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Generating numeric values in multiple cells using a single cell as reference.

    Value of cell is dependent of sum including this value?
    IMHO circular reference but maybe...
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

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

    Re: Generating numeric values in multiple cells using a single cell as reference.

    Hi,

    In order to generate a random, non-biased distribution of 8 integers with a given sum, it would be necessary to first generate the set of all permutations of 8 integers having that sum and to then choose one of those permutations at random.

    Since the number of such permutations for 30,236, for example, is greater than 10100,000, this approach is clearly not a feasible one.

    You will have to settle for a biased distribution, the extent of bias which you allow being proportional to the simplicity of the solution, I would imagine. One example of a heavily-biased formula approach would be (assuming e.g. 30,236 in A2) to enter:

    In B2:

    =RANDBETWEEN(1,A2-COLUMNS(C2:I2))

    In C2:

    =RANDBETWEEN(1,$A2-SUM($B2:B2)-COLUMNS(D2:$I2))

    and copied to H2

    In I2:

    =A2-SUM(B2:H2)

    Regards
    Click * below if this answer helped

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

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Generating numeric values in multiple cells using a single cell as reference.

    Not quite what you're after, but the best I can do.
    In B2 copied down & across to column H
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and in I2 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    69

    Re: Generating numeric values in multiple cells using a single cell as reference.

    Thanks both XOR LX and Fluff13, specially Fluff13 for a simple solution.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Generating numeric values in multiple cells using a single cell as reference.

    You're welcome & thanks for the feedback

+ 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] distribution of values from single cell to multiple cells in single column
    By WhatsGig in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 08-29-2017, 02:30 PM
  2. formula to combine multiple cells into single cell where reference is same
    By rexer231 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-12-2014, 11:44 AM
  3. Generating Macro to create multiple duplicate cells based on an input reference
    By Jomian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2013, 08:25 PM
  4. Sum values from multiple cells - multiple lookup values in single cell
    By taxdept in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2012, 04:12 PM
  5. Replies: 3
    Last Post: 01-28-2011, 03:19 AM
  6. [SOLVED] multiple numeric values applied to single text
    By Fam via OfficeKB.com in forum Excel General
    Replies: 5
    Last Post: 02-02-2006, 04:20 PM
  7. [SOLVED] Match Single Numeric Criteria and Return Multiple Numeric Labels
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-29-2005, 04:50 PM

Tags for this Thread

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