WORKAROUND
To resolve this issue, use one of the following methods.
Method 1
Make sure that the source cells for the calculations in the formulas are also sorted.
Example
What you see What is really there
------------ --------------------
A1: 1 B1: 2 A1: 1 B1: =A1+1
A2: 0 B2: 1 A2: 0 B2: =A2+1
If you select B1:B2 and sort in ascending order, you may see the results
of the formulas appear quickly in ascending order, but then the formulas
recalculate the original contents of the affected cells. This is because the source data entries in Column A are not included in the sort.
Method 2
Use this method if you want to replace the formulas with the resulting values permanently.
- Select the cells with the formulas, and then click Copy on the Edit menu.
- On the Edit menu, click Paste Special.
- On the Paste Special menu, click Values.
This replaces formulas with numbers for correct sorting.
Method 3
Use a macro to create an absolute reference (for example, =$A$1).
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
The following macro converts a range of cells to absolute references:
A1: =FOR.CELL("curcell",,TRUE)
A2: =FORMULA(FORMULA.CONVERT(GET.CELL
(6,curcell),TRUE,FALSE,1,curcell),curcell)
A3: =NEXT()
A4: =RETURN()
Method 4
Use the sheet name in the cell reference. When the sheet name is included, it remains the same as an absolute reference. However, you can use relative references (for example, = sheet1!a1+1), so that the formula can be easily copied throughout the range.