+ Reply to Thread
Results 1 to 9 of 9

Need to cascade a formula every 24 lines

  1. #1
    Registered User
    Join Date
    08-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    5

    Need to cascade a formula every 24 lines

    Hi guys, and thanks in advance for the help.

    I need to copy a formula to every 24th line, but need the referenced cell to only increase by 1.

    In this example cell C8 needs to reference a cell from a worksheet named v3i33

    C8=v3i33!A2

    I need to copy the formula down 24 lines at a time, so that:

    C32=v3i33!A3

    C56=v3i33!A4

    C80=v3i33!A5

    and so forth...any suggestions? I have to repeat this formula over 500 times, so entering it manually isn't an option.

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Need to cascade a formula every 24 lines

    Hi,
    Very easy with a macro :

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Registered User
    Join Date
    08-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Need to cascade a formula every 24 lines

    Not having any luck getting that macro to work. I am running another macro on this worksheet, so I'm somewhat familiar with the process. I added the macro, but when I try to use it as a function, it says "name not valid". This is probably user error...I'm not an Excel expert by any means.

  4. #4
    Registered User
    Join Date
    08-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Need to cascade a formula every 24 lines

    Also, I'd like to be able to accomplish this with a formula if possible. If I explain what I'm doing perhaps it will give you some insight. In one worksheet, I'll have data for all of my customers. In another worksheet (same document), I will have 500 invoices that need to be populated by the other worksheet. So C8 is the location of the Store Name on the first invoice, C32 is the Store Name for the second invoice. My reason for preferring formulas is that I can repopulate the invoices to the most current worksheet just by doing a simple Find/Replace to update the formulas to pull from another worksheet. (i.e., replacing v3i33, which is the worksheet i'm referencing to v3i34.)

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Need to cascade a formula every 24 lines

    Here!

    This should work.

    Put this in Cell C8 and commit using Ctrl+Shift+Enter

    Please Login or Register  to view this content.
    Let me know if it works?

    Deep
    Last edited by NeedForExcel; 08-12-2013 at 01:30 AM.
    Cheers!
    Deep Dave

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Need to cascade a formula every 24 lines

    The above formula will take care of 42 Formula entries. If it exceeds that we can either Alter the formula, or maintain the Match & Index Table seperately which I have maintained in the formula

    Deep

  7. #7
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Need to cascade a formula every 24 lines

    In C8

    =IF(MOD(ROW(),24)=8,INDEX(v3i33!A:A,INT(ROW(A1)/24)+2),"")

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  8. #8
    Registered User
    Join Date
    08-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Need to cascade a formula every 24 lines

    Quote Originally Posted by Ace_XL View Post
    In C8

    =IF(MOD(ROW(),24)=8,INDEX(v3i33!A:A,INT(ROW(A1)/24)+2),"")

    Copy down
    Thanks everyone for your contributions! Ultimately, Ace's formula is the one that led me to salvation. I actually couldn't use it directly, as my cells were sized and formatted differently for some of the following rows, and Excel wouldn't allow me to copy down. What I did eventually was use some columns outside of the print area to calculate the formulas then used the OFFSET function to reference them in the actual invoices. Other than that it worked perfectly, with the exception of one column that I can't get it to pull reference data for some reason. I don't really understand why...yet...still playing with it. Many thanks though! I've made a lot of progress with your help.

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Need to cascade a formula every 24 lines

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. [SOLVED] controlling a web site cascade dropdowns
    By bolekblues in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-10-2012, 05:20 AM
  2. Validation in cascade...
    By Jehan in forum Excel General
    Replies: 2
    Last Post: 06-19-2007, 08:47 AM
  3. [SOLVED] Cascade selection of Drop down menus
    By KC in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-05-2006, 07:10 PM
  4. [SOLVED] cascade combo in subform
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2005, 05:55 PM
  5. [SOLVED] Cascade Validation
    By matelot in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-17-2005, 10:20 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