+ Reply to Thread
Results 1 to 9 of 9

#REF! when sorting

  1. #1
    Registered User
    Join Date
    04-10-2009
    Location
    Sellersville, USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    #REF! when sorting

    We have an issue with sorting rows of data that have formulas in them.

    ---------------
    These formulas are using data from a row which is above the column headers.

    For example cell H2 has 160 manually entered in it. It's the number of work hours available in January 2009.

    The column header for that column is in Q4 and has a value of 'Jan'

    Below this in cell H5 is the formula '=+H2' because the resource in this row is available for 100% of the month.

    Another resource in row 22 has the formula '=+H2*0.15' in cell H22 because they are only available 15% of the time that month.

    ---------------
    The problem occurs when we try to sort this data. Most of the cells displays #REF!. Some show a value, but the calculation is wrong.

    Is there a solution to this issue?

    Thank you very much,

    Chuck

    I've attached the unsorted spreadsheet.
    Attached Files Attached Files
    Last edited by twelec; 04-11-2009 at 01:20 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: #REF! when sorting

    convert to absolute referencing i.d =$H$2
    incidently
    =+$H$5+$J$5+$L$5+$N$5+$P$5+$R$5+$T$5+$V$5+$X$5+$Z$5+$AB$5+$AD$5
    could be replaced by
    SUMPRODUCT((1-MOD(COLUMN(H5:AD5),2))*H5:AD5)
    Attached Files Attached Files
    Last edited by martindwilson; 04-10-2009 at 01:01 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    04-10-2009
    Location
    Sellersville, USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Smile Re: #REF! when sorting

    thank you very much - for both suggestions. this is my first time on the site, but not my last. didn't expect such a quick response.

    i was in an excel class yesterday & posed the same question - i was told it's impossible to do. very happy to find out different.

    thx again, chuck

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: #REF! when sorting

    And also be aware that in formulae beginning with "=+" the "+" is not necessary, just an heritage from the Lotus period

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: #REF! when sorting

    Quote Originally Posted by chuck
    i was in an excel class yesterday & posed the same question- i was told it's impossible to do.
    Martin specializes in the impossible.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Registered User
    Join Date
    04-10-2009
    Location
    Sellersville, USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: #REF! when sorting

    Quote Originally Posted by martindwilson View Post
    convert to absolute referencing i.d =$H$2
    incidently
    =+$H$5+$J$5+$L$5+$N$5+$P$5+$R$5+$T$5+$V$5+$X$5+$Z$5+$AB$5+$AD$5
    could be replaced by
    SUMPRODUCT((1-MOD(COLUMN(H5:AD5),2))*H5:AD5)
    Re: #REF! when sorting

    --------------------------------------------------------------------------------
    should have replied to directly your response - just want to thank you again - worked like a charm, chuck

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: #REF! when sorting

    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

  8. #8
    Registered User
    Join Date
    02-09-2008
    Posts
    32

    Re: #REF! when sorting

    Is there a key press to when selecting a cell to make it an 'absolute' reference?

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: #REF! when sorting

    Please read the forum rules about posting questions in other people's threads, and then start your own.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

+ 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