+ Reply to Thread
Results 1 to 3 of 3

Distributing values from existing column to two new columns

  1. #1
    Registered User
    Join Date
    02-27-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Distributing values from existing column to two new columns

    Hi,
    I am new to Macros and do not know how to distribute values from one column into two columns. Any sort of help will be appreciated
    To start with I have distributed data into three columns
    Column B with data <=250
    Column C with data >=850
    Column D with data between 250 and 850

    All I want is to distribute the data of Column D into Column B and Column C so that column B and column C have equal number of entries.
    For Example
    Data in Column B
    19
    241
    Data in Column C
    890
    970
    1001
    Data in Column D
    257
    370
    790
    810
    845
    So after the computation the data in column B and Column D should be
    Data in Column B
    19
    241
    257
    370
    790
    Data in Column C
    890
    970
    1001
    810
    845
    Last edited by burman.p; 03-04-2013 at 06:58 AM.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Distributing values from existing column to two new columns

    If we add the total items in columns B, C, and D and divide by 2, the result is the number of items that should occupy cols B and C after the macro has run. That is the idea behind:

    Please Login or Register  to view this content.

    For example:
    Attached Files Attached Files
    Last edited by Jakobshavn; 03-04-2013 at 02:50 PM.
    Gary's Student

  3. #3
    Forum Contributor
    Join Date
    01-07-2013
    Location
    south africa
    MS-Off Ver
    Excel 2003-13
    Posts
    210

    Re: Distributing values from existing column to two new columns

    Hello
    I am assuming the your problem is as simple as stated in your statement and there are no other rules to worry about.

    To get equal distribution, you will have to count the number of values in all columns and divide the answer by 2. You can use
    Please Login or Register  to view this content.
    and same for the other columns. (from the start to the last value)
    Then you can determine how many values you going to add in column B and C.

    So lets say you have column B = 290, column C = 844 and Column D = 1104 then you will get total = 2238. And divided by 2 = 1119
    So you need to add 1119 - 290 = 829 to column B and 15 to column C.

    Then you write a macro to bring those values into you columns:
    Please Login or Register  to view this content.
    I have assumed your columns have headings and started on row 2

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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