+ Reply to Thread
Results 1 to 2 of 2

VBA to add one column by all values of the adjacent 8 columns and three rows once each

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    7

    VBA to add one column by all values of the adjacent 8 columns and three rows once each

    Hi,

    I can't really wrap my head around how to do this or if there's even a formula or even a macro i could run to run this data.

    I have three rows of data (29-31) from columns D to Q.

    I would like to take D29 and add each of the values in the adjacent columns exactly once and sum up the value D thru Q

    For example I'd like to return not just Sum(D29:Q29) but also Sum(D29:R29)+Q30, Sum (D29:R29) +Q31.

    Could anyone on this board think of a way to help me write a macro that would add these values?

    That is D29 + E29 or E 30 or E31 + F 29 or F 30 or F 31 + G 29 or G 30 or G 31... and on?

    Even though I wrote "or" above, i would need the other values to be added in a separate calculation, until all possible permutations of D and the following 8 columns and 3 rows of data are exhausted.


    It's impossible to me,
    But you guys are way better than I am!

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,616

    Re: VBA to add one column by all values of the adjacent 8 columns and three rows once each

    As this threads awaits answer already some time, probably other forumers also has problems with understanding.

    So my frank advice: (as forum rules also suggest) post a sample workbook (few fictious data) and show at least few first "manually calculated/assesed" results.

    Also: you probably do not look for permutations (different arrangements of elements of the same set - does not important for adding elements, because sequence within sum does not matter).
    Best Regards,

    Kaper

+ 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: 0
    Last Post: 07-24-2013, 11:13 AM
  2. How to find closest values in multiple columns and return adjacent values.
    By Patrician in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-28-2013, 01:47 PM
  3. Replies: 3
    Last Post: 07-30-2012, 11:20 AM
  4. Moving multiple values from Column A to adjacent columns
    By marker61 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2009, 02:34 AM
  5. Replies: 6
    Last Post: 03-04-2006, 07:30 AM

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