+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Formula Cell References Change When Sorting After Filtering

  1. #1
    Registered User
    Join Date
    12-22-2010
    Location
    Fairfax, VA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Formula Cell References Change When Sorting After Filtering

    I have encountered an odd problem in Excel 2007. I am referencing cells in formulas. When I filter and then sort the records, the cell references change. Does anyone know why?

    Below is some example data, which I have placed in an Excel's columns A-F and rows 1-10. Also, is an attached PDF with the example data.

    Here is what I do to get the error. First I go to "Data > Sort & Filter > Filter" to add the drop down menus in the data column headers. Then I filter by "Grp", so the records for only one "Grp" is displayed. Finally, I sort the group data by "Yrs Emp". This will cause the cells referenced in "Emp Pct of Grp Bns" to change, which makes the results wrong.

    Formula for "Emp Pct of Grp Bns": =D2/(D2+D4+D6+D8+D10)
    This formula is for "Grp" 1 records. The cell being devided, in this case D2, will be changed to D4, D6, D8, and D10 for their respective rows. "Grp" 2 records has a simular formula that only references the "Grp" 2 data.

    Formula for "Emp Bns": =B2*E2
    The row number will change to the row the formula is located.


    Grp Grp Bns Emp ID Yrs Emp Emp Pct of Grp Bns Emp Bns
    1 5000 A 1 =D2/(D2+D4+D6+D8+D10) =B2*E2
    2 4000 B 5 =D3/(D3+D5+D7+D9) =B3*E3
    1 5000 C 10 =D4/(D2+D4+D6+D8+D10) =B4*E4
    2 4000 D 1 =D5/(D3+D5+D7+D9) =B5*E5
    1 5000 E 5 =D6/(D2+D4+D6+D8+D10) =B6*E6
    2 4000 F 10 =D7/(D3+D5+D7+D9) =B7*E7
    1 5000 G 1 =D8/(D2+D4+D6+D8+D10) =B8*E8
    2 4000 H 5 =D9/(D3+D5+D7+D9) =B9*E9
    1 5000 I 10 =D10/(D2+D4+D6+D8+D10) =B10*E10
    Attached Files Attached Files

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Formula Cell References Change When Sorting After Filtering

    Nice pdf, wouldn't the excel file be more useful?

  3. #3
    Registered User
    Join Date
    12-22-2010
    Location
    Fairfax, VA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Formula Cell References Change When Sorting After Filtering

    Here is the Excel version.
    Attached Files Attached Files

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Formula Cell References Change When Sorting After Filtering

    Try this in E2
    Please Login or Register  to view this content.
    Drag/Fill Down

    Adjust to suit your real ranges

    Hope this helps
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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