+ Reply to Thread
Results 1 to 9 of 9

Insert new raw at the end without udpating the ranges in forumla??

  1. #1
    Registered User
    Join Date
    08-25-2008
    Location
    Bahrain
    Posts
    25

    Insert new raw at the end without udpating the ranges in forumla??

    I have the following table

    Clomun A, Colmun B
    Row 4 29-Apr-05, 100
    Row 5 31-May-05, 98.05
    Row 6 30-Jun-05, 99.52
    Row 7 31-Jul-05, 104.90
    .. .. ..
    Row 43 31-Jul-08, 180.44

    and following formulla to calculate the compounded rate of return

    =(B43/B4)^(1/((A43-A4)/365))-1

    Column A is for Date data, and Column B is for monthly price data

    Currenlty, the data start from row number 4 and it ends at row number 43.
    At every month end I add new row after the last data I have. Every time I insert a row I have to manually update the reference range in the formula to cover the new row inserted which is annoyying. i.e. Now I need to insert a new row which should be row number 44, but the reference range convered by the forumulla is upto row 43. So how I can make the worksheet automatically get the reference range in the forumulla updated so to include any new row inserted at the end.

    I'm sure there is a way by which excel can update the reference range as and when I insert a new raw with data.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    change
    =(B43/B4)^(1/((A43-A4)/365))-1
    to =(B43/$B$4)^(1/((A43-$A$4)/365))-1
    then
    simply drag down
    if you are only inserting data into cola+b you caan do it in advance

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Hi,
    you might want to use Dynamic Ranges so the range wil adapt automatically
    Cheers

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    =(LOOKUP(9.999999999E+307,B:B)/B4)^(1/((LOOKUP(9.999999999E+307,A:A)-A4)/365))-1
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    08-25-2008
    Location
    Bahrain
    Posts
    25
    Thanks everybody for help

    NBVC
    Your suggestion works, but why the result is slightly different from the result I get with my orginial formulla.

    Many thanks for help

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Can you elaborate on what you mean? All my formula does is take the last entry in column B and column A and insert them in the formula... the rest is your formula...

  7. #7
    Registered User
    Join Date
    08-25-2008
    Location
    Bahrain
    Posts
    25
    Sorry your formmulla works fine, it was my mistake ... thanks alot for help

    It's really great forum that I was missing long time
    Last edited by alghareeb; 08-25-2008 at 11:56 AM.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Strange...

    Is there any data below row 43 at all?

    Are both column A and B occupied in last row?

    If yes to both questions, maybe you can attach a sample workbook so I can see what may be going on.

  9. #9
    Registered User
    Join Date
    08-25-2008
    Location
    Bahrain
    Posts
    25
    NBVC
    Your forumulla works perfectly, you are great. Thanks so much

    But I would love to know what's the logic fbehind using (LOOKUP(9.999999999E+307))

    Thank you very much for help

+ 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: 1
    Last Post: 08-25-2008, 07:17 AM
  2. Insert Row Based Upon Cell Value
    By carguy935 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2008, 02:09 AM
  3. Double value insert into DB
    By burrug in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-18-2008, 04:57 AM
  4. insert row, copy formulas, have code example (I think).
    By gobbolino in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2007, 12:10 AM
  5. Insert Formula
    By Altec101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2007, 02:43 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