+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Maintain Formula while Sorting Cells

  1. #1
    Registered User
    Join Date
    11-04-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    Maintain Formula while Sorting Cells

    I've tried looking for this, but I can't seem to find the solution, maybe I'm not searching for the right terms, I don't know.

    So, this is what I'm trying to do:
    I have an Excel Workbook, with several sheets.

    The first list is a Cost of Supplies sheet, with lists of the supplies I've bought, how much they cost, and where I got them.

    The next is an Item Catalog with the item name, description and quantity on hand. I was trying to make a column called "Cost to Make" which used a formula to to add the prices of the supplies from the Cost of Supplies sheet, tell me how I spent to make the Item. The formula looks like this: ='Cost of Supplies'!C6+'Cost of Supplies'!C7+'Cost of Supplies'!F30

    On the Cost of Supplies sheet, I use the Sort function to sort the supplies alphabetically. When I went back to the Item Catalog sheet, my formula remained the same and therefore was using the wrong cells and giving me the wrong price.

    Is there a way I can sort of have the formula update so that it follows the cells if they are moved during a sort and thus maintains the correct cells and data?

    There's probably an obvious answer to this, but I'm fairly new to Excel.
    Attached Files Attached Files
    Last edited by th3fac3insid3; 11-04-2011 at 01:24 PM. Reason: Attached Dummy workbook

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

    Re: Maintain Formula while Sorting Cells

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    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.

  3. #3
    Registered User
    Join Date
    11-04-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Maintain Formula while Sorting Cells

    Thanks for the advice. I edited the post and attached a dummy workbook, I used before and after worksheets and I highlighted the cell I'm having issues with.

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

    Re: Maintain Formula while Sorting Cells

    What is the actual logic of your formula. Are you adding up the matching colours only? Is there any other logic.. i.e. does quantity, item # or Notes, etc...

    Have you looked into SUMIF formula or SUMPRODUCT?

  5. #5
    Registered User
    Join Date
    11-04-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Maintain Formula while Sorting Cells

    So the formula... I used black, green, and red to make the item, so I started the formula by just adding the price of Black, Green and Red by referencing their prices on the Cost of Supplies sheet.

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

    Re: Maintain Formula while Sorting Cells

    What if you replace the formula in E2 to:


    Please Login or Register  to view this content.

+ 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