+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Valued Forum Contributor
    Join Date
    06-30-2005
    Location
    Verwood, Dorset, England
    MS-Off Ver
    Excel 2000
    Posts
    469

    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 06:52 AM.
    Paul

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    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
    469

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

    Thanks that solved it
    Paul

  4. #4
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,447

    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
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

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.2.0