+ Reply to Thread
Results 1 to 4 of 4

Cell Reference After Sorting

  1. #1
    Registered User
    Join Date
    07-27-2011
    Location
    Louisiana, United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Cell Reference After Sorting

    I am currently using the following formula to search and add all data related to cell related to B16. When I add an additional line and sort, B16 is no longer the correct reference cell. Is there any way for excel to search column "B" and the current row the formula is in after sorting?



    =SUMIF('MONTHLY REPORT'!$A$2:$A$59999,'CLIENT MASTER LIST'!$B16,'MONTHLY REPORT'!$F$2:$F$59999)

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Cell Reference After Sorting

    Hi mattlandry,

    Welcome to the forum!!

    Naming the range (i.e. cell B16 in this case) should do the trick. To do this follow these four steps:

    1. Ensure your cursor is on the desired tab and cell for the criteria part of the SUMIF function to reference
    2. Press Ctrl + F3 to display the Define Name dialog
    3. In the Names in workbook textbox, enter a name for the range say: SumIfCriteriaValue
    4. Click OK

    You can now reference the value held in the range defined in step 3 above (regardless if its position changes) as you would any other cell, i.e.

    =SumIfCriteriaValue or as part of your original formula;
    =SUMIF('MONTHLY REPORT'!$A$2:$A$59999,SumIfCriteriaValue,'MONTHLY REPORT'!$F$2:$F$59999)

    HTH

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    07-27-2011
    Location
    Louisiana, United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Cell Reference After Sorting

    Thanks seems to have worked

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Cell Reference After Sorting

    Thanks for letting us know and you're welcome

    If you could mark the thread as closed, it would be appreciated.

+ 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