+ Reply to Thread
Results 1 to 4 of 4

Problem with formula returning #REF! if I delete the first or last row of data

  1. #1
    Valued Forum Contributor
    Join Date
    06-30-2005
    Location
    Verwood, Dorset, England
    MS-Off Ver
    Excel 2000
    Posts
    479

    Problem with formula returning #REF! if I delete the first or last row of data

    I am using excel 2000

    I have the following formula,

    [HTML]=CONCATENATE("Consultants -"," ",(SUBTOTAL(3,G2:G13))-SUMPRODUCT(SUBTOTAL(3,OFFSET(G2:G13,ROW(G2:G13)-ROW(G2),0,1))*(G2:G13="Vacant"))-SUMPRODUCT(SUBTOTAL(3,OFFSET(G2:G13,ROW(G2:G13)-ROW(G2),0,1))*(G2:G13="Proposed"))," ","Vacancies -"," ",SUMPRODUCT(SUBTOTAL(3,OFFSET(G2:G13,ROW(G2:G13)-ROW(G2),0,1))*(G2:G13="Vacant"))," ","Proposed -"," ",SUMPRODUCT(SUBTOTAL(3,OFFSET(G2:G13,ROW(G2:G13)-ROW(G2),0,1))*(G2:G13="Proposed")))/HTML]

    which counts various attributes in the column above, I want to be able to delete rows and the formula still work, however when I delete the first or last row of data in the range I get #REF!, see below

    [HTML]=CONCATENATE("Consultants -"," ",(SUBTOTAL(3,G2:G12))-SUMPRODUCT(SUBTOTAL(3,OFFSET(G2:G12,ROW(G2:G12)-ROW(#REF!),0,1))*(G2:G12="Vacant"))-SUMPRODUCT(SUBTOTAL(3,OFFSET(G2:G12,ROW(G2:G12)-ROW(#REF!),0,1))*(G2:G12="Proposed"))," ","Vacancies -"," ",SUMPRODUCT(SUBTOTAL(3,OFFSET(G2:G12,ROW(G2:G12)-ROW(#REF!),0,1))*(G2:G12="Vacant"))," ","Proposed -"," ",SUMPRODUCT(SUBTOTAL(3,OFFSET(G2:G12,ROW(G2:G12)-ROW(#REF!),0,1))*(G2:G12="Proposed")))/HTML]

    What do I need to change to stop this happening
    Last edited by Paul Sheppard; 08-16-2010 at 05:52 AM.
    Paul

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Problem with formula returning #REF! if I delete the first or last row of data

    Presumably by first row you mean row 2 ?

    You can replace each instance of:

    ROW(G2)

    with

    ROW(INDEX(G2:G13,1))

  3. #3
    Valued Forum Contributor
    Join Date
    06-30-2005
    Location
    Verwood, Dorset, England
    MS-Off Ver
    Excel 2000
    Posts
    479

    Re: Problem with formula returning #REF! if I delete the first or last row of data

    Thanks that solved it

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Problem with formula returning #REF! if I delete the first or last row of data

    In future pa attention to the Forum Rules

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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