Results 1 to 5 of 5

Thread: Updating formulas for future rows

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Updating formulas for future rows

    i have a formula that i may need to change the ranges within the formula on occasion, without affecting results for previous rows
    a simple example is

    =C5*P$3-F5+N4, where c5 is in the current row, but P$3 needs to be changed to an updated value obviously if i change the value in p3 then all previous results are also changed
    the cells needs to be updated to the bottom of the sheet, but some rows contain subtotals so i can't just drag the updated formula to the bottom of the usedrange
    also subtotal rows need to be skipped where N4 above is the previous row, at subtotals needs to be 1 or 2 rows above the previous row

    the most complicated example is
    =ROUND((SUMPRODUCT(--(J5*52>tt!A$5:A$8 ), J5*52-(tt!A$5:A$8),tt!B$5:B$8-tt!B$4:B$7))/52+J5*tt!$D$5+0.49,0)
    where all the same conditions apply, though no cumulative totals are required
    i have successfully converted this formula to use a named range for tt sheet ranges, but again updating the named range either by value or name will change previous result

    i am looking for some simple method for any update required
    i have been considering a vba solution, but thought i would post here first to see if anyone has a better method
    Last edited by westconn1; Sep 6th, 2021 at 07:32 AM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width