Share via

Range Names not sorting correctly

Anonymous
2016-01-24T19:01:46+00:00

I have a master sheet of data. I am naming the cells in the last column with individual names. When I sort the data, the range name is not moving with the data??

In the example below, I have named the cell that contains the total cost for celery as: "Celery." If I sort the whole range, the name of the cell now point to the cell that contains the price for Beets. 

Am I mistaken? Shouldn't the name move with the row? I am pretty sure it used to do that.

Item Price Amount Total Cost
Celery $1.00 12 $12.00
Beets $.50 10 $ 5.00
Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

7 answers

Sort by: Most helpful
  1. Bob Jones AKA CyberTaz MVP 436K Reputation points
    2016-01-26T16:58:19+00:00

    I'm not sure what it is that you're trying to do. Why not simply sort based on the 1st column? It's the one that uniquely identifies the record on each row.

    Why do you think you need to use range names? As you noted, it just won't work for the reasons I explained... In a nutshell, sorting involves only the data & range names are neither data nor are they associated with the content of the cell to which they're assigned.

    If you can explain what it is that you're actually trying to accomplish perhaps I or someone else can offer some usable suggestions.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-01-26T16:02:39+00:00

    Is there a way to still use range names and have this work? Intersecting names perhaps?

    Was this answer helpful?

    0 comments No comments
  3. Bob Jones AKA CyberTaz MVP 436K Reputation points
    2016-01-26T12:08:05+00:00

    Range names are assigned to specific groups of cells, not the data they contain. When sorted, the data is rearranged but the rows are not. IOW, after you sort, different content will appear in the cells on each row relative to how the data is rearranged, but the name assigned to those cells remains the same. E.g., if the name Celery is assigned to B2, a price other than the price for celery will appear in that cell but the name Celery is still assigned to B2.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-01-25T23:09:43+00:00

    HI Joe,

    Thanks for your reply. Which column I am sorting by is not the issue. 

    The issue is that after the range has been sorted, the original cell (D3) in the example, which I named "Celery", is now in the position (D2).

    The Range Name "Celery" continues to point to D3, when it should point to D2.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2016-01-25T16:19:07+00:00

    It seems that you have placed the cursor on the row celery and then initiated the sort function.

    Was this answer helpful?

    0 comments No comments