+ Reply to Thread
Results 1 to 43 of 43

The fastest way to Distribute new Values in Table

  1. #1
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Exclamation The fastest way to Distribute new Values in Table

    Hi folks,

    In attachment you can find very big table with Data. In Columns H:S I have Number Values which I get from Server. I am tracking this Values but my problem is....

    Often, I get info that I need to increase some Values for 10.000 or 20.000. Doesn't matter.

    E.G. I've situation that I need to split 10.000 in April 2016 based on percentage in column G with next filters:

    Column A (Country) - EU
    Column B (Ter.) - EU403
    Column C (Mark) - B
    Column D (Division) - Financial
    Column E (Type) - FIRST
    Column F (Type Name) - First3 or it could be combination (First3 and First13)

    So, what is the best or easier way to do this.

    I've tried with some Pivot Table but without success or maybe I was on wrong way with my Pivot Table.

    Is it possible to create macro for this or Query in Access....whatever, just to work

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: The fastest way to Distribute new Values in Table

    So you're asking that 10 be divided among the remaining rows (with the filters you quoted, there are 3 rows) based on their relevant weights (Col G) and added to what is already in Col K (April 2016)?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    You are right, in this case there are only 3 rows that I need to populate and it's not 10 but 10 000.
    So, for these 3 rows in Column K, cell K3087 (April 2016) I should have formula = 10+(10 000 * 0.97) and so on...
    In my original file which is almost 10 MB I have for this filters almost 50 rows and as you know I can upload here only 1mb.
    Also I have situation e.g. when I need to include 2 months...

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: The fastest way to Distribute new Values in Table

    Okay, using this example, it would be
    10+10000*0.97%/3.91%
    3.91 is the sum of the unfiltered weighted values

    Here's my suggestion,
    Step 1. Insert a column before the dates, For the header, use 1 as a placeholder
    =Table_NAMER11[[#Headers],[10.00]]*[@[Rel Weight]]/SUBTOTAL(9,[Rel Weight]) Format Col H as Number with 0 decimals

    Step 2
    Filter what you need to filter, place the value you want into header H (change 1 to 10000)
    You shoulld get 3 rows that add up to 10000 (with negligible differences due to rounding)

    Step 3
    Copy these three cells and select the cells in L (Apr -16)
    Paste Special > Select "Add" AND "Values" Hit "OK"

    Done
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: The fastest way to Distribute new Values in Table

    Step 1 is a one tiime event. Once it's in place, it can stay there. It doesn't hurt anything.

  6. #6
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Sorry, but I am very confused now. How did you get these numbers?
    As I can see in cell H3087 is 2488. So =2488+10(from L3087)= 2498 and you have 2501?
    The SUM for L3087+L4866+L4892 is 12 401??

    I downloaded your file and in Column H I have % Values, is this correct?
    How did you create this formula?

    Sorry again, but I can't catch you.

    P.S. I am not able to copy the formula from step 1. Where I need to put it?
    Last edited by toci; 03-15-2016 at 04:29 PM.

  7. #7
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    If you can explain me this once more again, I would appreciate it.
    As I said, don't know how to generate and where to put this formula. When I try to insert it in cell H2 I get some kind of error.
    Second, when I get the numbers in Column H (inserted) I must SUM that numbers with numbers in Column L for April 2016.

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: The fastest way to Distribute new Values in Table

    Okay, probably messed some numbers up while experimenting. However, I do see now that if I try to copy paste ADD and VALUES at the same time, it doesn't work properly.

    It does work if you just do Paste Special > Add
    That adds the formula into those cells, then you need to copy>Paste Special> Values on top of itself to remove formula
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Ohhhh, finally I figured out.

    Thank you very much!

  10. #10
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Once more question regarding Copy--->Paste Special--->Add

    When I do this it doesn't copy the data on the same (filtered) cells? It ADD values into filtered cells, how's that?

    Thanks.

  11. #11
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Can you check this example for Copy--->Add

    Filtered cells are the BIG problem!

    Is there any solution for this?
    Attached Files Attached Files
    Last edited by toci; 03-15-2016 at 07:23 PM.

  12. #12
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: The fastest way to Distribute new Values in Table

    Ahhhh, I see the problem. The only solution I can think of is to do that one row at a time which I think you said would not be viable. I'm thinking now that VBA will be necessary. I'll ask for some of the VBA experts to take a look.

  13. #13
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Thank you, again.

  14. #14
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Do we have any progress regarding VBA?

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  16. #16
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Quote Originally Posted by xladept View Post
    Try this:

    Please Login or Register  to view this content.
    Hi #xladept,

    Thank you for help, but this code is for this example, am I right?
    I have a hundreds combination for filter so this won't work if I change my filters.
    Also, this line of code
    Please Login or Register  to view this content.
    10000 is in this Case, but it changes every day...

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    Well, I've got to go to work now. How do you want the criteria? Have you a list? Are they on a worksheet? What? Where?

  18. #18
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    You can download file from post #11, Clear Filters and from A1:F1 are my combinations.
    Thanks.

  19. #19
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    You could enter the criteria right into the already submitted code or something like this:

    Please Login or Register  to view this content.

  20. #20
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Sorry man, I don't understand this Code. Can you explain me what this code actually doing?
    I thought it's for Copy--->Paste Special--->Add Data over Filtered Cells?

  21. #21
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    After the filter, the program just processes the visible rows. What would it copy the amount is calculated? Have you run macros
    before?

    Here's a corrected version that yields the 2498 etc.

    Please Login or Register  to view this content.
    Last edited by xladept; 03-17-2016 at 07:35 PM.

  22. #22
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    When I finished with filtering (Columns: A,B,C,D,E,F), in Column H, cell H1, I put some Values e.g. 10000 and get what I want below in that column. Than, I run macro and it hide all my rows which were visible after filtering ??
    So, did I miss something.
    And I have run a lot of macros before
    Can you check this once more again?
    Last edited by toci; 03-17-2016 at 07:39 PM.

  23. #23
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    Post #11 did nothing for me. Am I looking at the same thing you are?

  24. #24
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    OK.
    Please, open this attachment. I've already filtered some data, so the last step is to run a macro, but before you start a macro check into the VBA if I messed something with the code.
    As I understood you this macro should show me only visible cells or I am wrong?

  25. #25
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    There's no attachment on post #24

    But, you're right the macro doesn't reset the filter until the next run.

  26. #26
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Sorry for the attachment.
    Here it is.
    Attached Files Attached Files

  27. #27
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    This works:

    Please Login or Register  to view this content.

  28. #28
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Yes, this works great, but...
    As I can see this macro ADD Values from H to K Column, but what about if I need to put these Values from H into e.g. Column: K, M, P as well?
    Is it possible to add MsgBox or something else which will ask in which Column I would like to insert these Values?

  29. #29
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    If you're going to manually filter the data we can eliminate a bunch of code:

    Please Login or Register  to view this content.

  30. #30
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Oooo MAN, congratulations! That's it!

    Thank you very much!

    I appreciate your work!

  31. #31
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    You're welcome and thanks for the rep!

  32. #32
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    Here's code if you want to Autofilter:

    Please Login or Register  to view this content.
    if you want to actually autofilter then just put an apostrophe before
    Please Login or Register  to view this content.
    Last edited by xladept; 03-18-2016 at 09:38 PM.

  33. #33
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    Hi Toci,

    With this code:

    Please Login or Register  to view this content.
    I get:Toci.PNG
    Last edited by xladept; 05-19-2016 at 12:05 PM. Reason: Correction

  34. #34
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Yes, this works excellent!
    Thank you, again!

  35. #35
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    You're welcome and thanks for the rep!

  36. #36
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    #xladept Man, don't be angry on me..... I think this would be the final question.
    As you can see in the example, I inserted 12 Columns with formulas. Column H should be related with Column T (Jan-16), column I should be related with Column U (Feb-16) and so on and so forth. So values from column H go to column T, values from column I go to column U and so on.
    Is it possible to edit existing macro to do this?
    Attached Files Attached Files

  37. #37
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    Hi Toci,

    Try this:

    Please Login or Register  to view this content.

  38. #38
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Doesn't work. I have filtered data. It seems it adds values through filtered rows?

  39. #39
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    Hi Toci,

    It worked on your sample, have you a different sample?

  40. #40
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    Hi, no I don't have a different sample.
    After macro check the values in last row. It seems that macro doesn't add data. If we look Column H row 5588, it has value 308, and it should go to column T, where I have value 3. 308+3=311 and after macro I have 308?
    Attached Files Attached Files

  41. #41
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    Hi Toci,

    Try this:

    Please Login or Register  to view this content.

  42. #42
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: The fastest way to Distribute new Values in Table

    the last one is PERFECT! Cheers man!

    Thank you!

  43. #43
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: The fastest way to Distribute new Values in Table

    You're welcome!

+ 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: 1
    Last Post: 12-18-2014, 09:43 PM
  2. Distribute the value of number according to table
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2014, 01:01 PM
  3. Fastest way to copy values from one workbook to another
    By Ztv in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-17-2014, 03:31 AM
  4. [SOLVED] fastest vba code to add (many) new rows into a protected table at the same time
    By jimmalk in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-23-2012, 07:23 AM
  5. [SOLVED] Calculating Fastest time in pivot table
    By Jonga21 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 10-29-2012, 01:12 PM
  6. Fastest way to fill in values on a form
    By wilro85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-29-2007, 08:28 PM
  7. [SOLVED] fastest sorting routine for 2-D array of long values
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-06-2006, 12:10 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