+ Reply to Thread
Results 1 to 6 of 6

Range Subtraction / Matrix Subtraction - Large data set

  1. #1
    Registered User
    Join Date
    02-26-2015
    Location
    France
    MS-Off Ver
    2013
    Posts
    5

    Range Subtraction / Matrix Subtraction - Large data set

    Hello - I would like to subtract two ranges using vba macro and post the difference to a new sheet. Specifics are as below:

    Specifics: The data sets are large in size - It has 600 rows of products by 12 columns of months for close to 10-15 countries. And data set of each country is in one tab

    Data Set :

    Product Region Jan Feb Mar Jan Feb Mar
    Pepsi Germany 10 15 20 5 10 5

    Result: In a new workbook/worksheet

    Product Region Jan Feb Mar
    Pepsi Germany 5 5 15

    I tried by using ARRAY but I think it will be very slow trying to read line by line, cell by cell, calculate the difference and paste it in new sheet.

    Could some one recommend a faster method to do - where we can read the two data sets in one go, do the calculations in memory and post the results.

    My logic: This is just sample with 20 rows for one country. But I will need to loop around all the countries.

    Please Login or Register  to view this content.
    Thank you.
    Last edited by excelrabbit; 11-20-2015 at 05:26 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Range Subtraction / Matrix Subtraction - Large data set

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  3. #3
    Registered User
    Join Date
    02-26-2015
    Location
    France
    MS-Off Ver
    2013
    Posts
    5

    Re: Range Subtraction / Matrix Subtraction - Large data set

    Done. Does it comply with forum rules now ? thanks

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Range Subtraction / Matrix Subtraction - Large data set

    It's OK now but can you please upload example workbook so we can work on it.

    Make sure there is just enough data to demonstrate your need.
    Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.
    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Range Subtraction / Matrix Subtraction - Large data set

    It's OK now but can you please upload example workbook so we can work on it.

    Make sure there is just enough data to demonstrate your need.
    Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.
    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  6. #6
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Range Subtraction / Matrix Subtraction - Large data set

    something like that i guess:

    Please Login or Register  to view this content.
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

+ 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. Setting the range of numbers, and performing subtraction
    By ayhp91 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-30-2014, 01:02 AM
  2. Subtraction in excel for a large data alternative rows
    By paapachak in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-02-2013, 12:39 PM
  3. Alternate Row subtraction in excel for a large data
    By paapachak in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 10-02-2013, 12:39 PM
  4. Alternate Row subtraction in excel for a large data
    By paapachak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2013, 12:38 PM
  5. Alternate Row subtraction in excel for a large data
    By paapachak in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-02-2013, 12:28 PM
  6. Subtraction of data and transfer to other sheets
    By lmtzprog in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-23-2010, 02:36 PM
  7. Reference range of cells and perform subtraction or nothing depending on contents
    By bob-hamilton in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-05-2006, 12:30 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