+ Reply to Thread
Results 1 to 3 of 3

Formula to subtract 7th column values from the column before the 1st (loop)

  1. #1
    Registered User
    Join Date
    02-21-2014
    Location
    Chennai
    MS-Off Ver
    Excel 2013
    Posts
    15

    Formula to subtract 7th column values from the column before the 1st (loop)

    I have a code that inserts a new column after every 7th column. I want to include a formula where every 7th column value is subtracted from the values present in the column before the 1st, or you can think of it as subtracting 7th column of the present group from the 7th column of the previous group. Example: The range of my data starts from col F, then

    F (7th) New Column (G) H (1st) I (2nd) J (3rd) K (4th) L (5th) M (6th) N (7th) New Column (O) P (1st) Q (2nd) R (3rd)

    So, New Column (O) = N - F
    and the next New Column (W) = V-N ...

    NOTE: Column G can be ignored.

    I want to add a looping function to this so that it will continue to subtract for the other respective columns as well.

    How do I incorporate this into the following code?

    Please Login or Register  to view this content.
    P.S. I'm using Excel 2013 and I'm a beginner at this so any help would be much appreciated!
    Last edited by saya_26; 02-21-2014 at 06:33 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Formula to subtract 7th column values from the column before the 1st (loop)

    Just reverse it.....

    Change this

    Please Login or Register  to view this content.
    To

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    02-21-2014
    Location
    Chennai
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Formula to subtract 7th column values from the column before the 1st (loop)

    Thanks for your reply

    Although that wasn't exactly what I was looking for. But I actually found another way around it. I filled up the blanks cells in columns with 0. Then used the insert columns macro as specified in my original post. Then used the Go To Special option to select only the blank cells which in this case would now only be the new columns. I typed the subtract formula, clicked Ctrl and tapped Enter. This copied the formula down all the respective new columns. ^^

    Now I need to see how I can select and delete the columns at specific intervals..
    Last edited by saya_26; 02-22-2014 at 09:18 AM.

+ 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. VBA code to Subtract values in Column F with Column E if found non-blank
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2013, 04:34 AM
  2. subtract values of column E, user entry
    By myjebay1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2012, 02:58 PM
  3. Subtract Values in the same column help
    By GE2014 in forum Excel General
    Replies: 7
    Last Post: 05-31-2012, 01:01 PM
  4. Subtract Values in the same column help
    By GE2014 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 05-31-2012, 11:50 AM
  5. subtract values in a column
    By mdshotgun in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2011, 11:28 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