XL97: How to Sort Cells Without Sorting Linked Cells

Last reviewed: January 7, 1998
Article ID: Q174537
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Excel 97 for Windows

SUMMARY

If you create links to a range of cells and you sort the data to which the cells are linked, the linked cells are updated with the sorted data. This article contains an example that sorts linked data without affecting cells that are linked to the original data.

MORE INFORMATION

In the following example, the formulas in column D are linked to cells in columns A and B. When you sort the data in columns A and B, the formulas in column D are not affected. To use this example, follow these steps:

  1. On a new worksheet, enter the following values:

          A1: 10     B1: 0     C1:     D1: =Offset($A$1,B1,0)
          A2: 20     B2: 1     C2:     D2: =Offset($A$1,B2,0)
          A3: 30     B3: 2     C3:     D3: =Offset($A$1,B3,0)
          A4: 40     B4: 3     C4:     D4: =Offset($A$1,B4,0)
    
    

  2. Select cells A1:B4.

  3. On the Data menu, click Sort.

  4. Click Column A in the Sort By box and click Descending. Click OK.

The linked cells remain linked to the data as it appeared in the original order even after you sort the data in columns A and B.

NOTE: You must select both column A and column B to sort the list in the example. The formula uses column B as the original offset row number.

REFERENCES

For more information about the OFFSET function, click the Index tab in Microsoft Excel Help, type the following text

   offset

and then double-click the selected text to go to the "OFFSET" topic.


Additional query words: XL5 XL7 XL97 howto
Keywords : xlformula xllist
Version : WINDOWS:5.0,5.0c,7.0,97
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 7, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.