Excel Table sort using cell references...

Jimmypop

Well-known Member
Joined
Sep 12, 2013
Messages
753
Office Version
  1. 365
Platform
  1. Windows
Good day all

I have a Table1. Two Columns. The one columns has site names and the other columns has values inside them. These values are populated from a cell refreence on the same sheet e.g. =AI2...

Now my issue is when I sort the table values column from largest to smallest it only sorts the first columns (site names) and does not sort the values column (which come from the cell references)... Appreciate any assistance in this regard...
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try locking the rows like =AI$2
 
Upvote 0
Have you added a second sort level?

Sort by : Column 1, Then By : Column 2 ?
 
Upvote 0
Try locking the rows like =AI$2

Hi Fluff

Then my table only references the first row... so basically goes from this:

Near Misses for month end report.xlsx
AB
44SiteTotal NM Reported
45Site11
46Site212
47Site31
48Site42
49Site57
50Site6 
51Site714
52Site82
53Site9 
54Site1011
55Site111
56Site1213
57Site13 
58Site1426
59Site151
60Site16 
61Site171
62Site184
63Site1923
64Site201
65Site21 
66Site2219
67Site2315
68Site24 
69Site25 
70Site26 
71Site271
72Site28 
73Site294
74Site30 
75Site31 
76Site32 
77Site33 
78Site34 
79Site35 
80Site36 
81Site375
82Site38 
83Site39 
84Site40717
Sheet1
Cell Formulas
RangeFormula
B45:B84B45=AI2
to this
Near Misses for month end report.xlsx
AB
44SiteTotal NM Reported
45Site11
46Site21
47Site31
48Site41
49Site51
50Site61
51Site71
52Site81
53Site91
54Site101
55Site111
56Site121
57Site131
58Site141
59Site151
60Site161
61Site171
62Site181
63Site191
64Site201
65Site211
66Site221
67Site231
68Site241
69Site251
70Site261
71Site271
72Site281
73Site291
74Site301
75Site311
76Site321
77Site331
78Site341
79Site351
80Site361
81Site371
82Site381
83Site391
84Site401
Sheet1
Cell Formulas
RangeFormula
B45:B84B45=AI$2
And need it sorted like: (which I can do but only if I convert the table back to a range and then sort - I would however like to keep the table)
Near Misses for month end report.xlsx
AB
44SiteTotal NM Reported
45Site40717
46Site1426
47Site1923
48Site2219
49Site2315
50Site714
51Site1213
52Site212
53Site1011
54Site57
55Site375
56Site184
57Site294
58Site42
59Site82
60Site11
61Site31
62Site111
63Site151
64Site171
65Site201
66Site271
67Site6
68Site9
69Site13
70Site16
71Site21
72Site24
73Site25
74Site26
75Site28
76Site30
77Site31
78Site32
79Site33
80Site34
81Site35
82Site36
83Site38
84Site39
Sheet1
 
Upvote 0
What is the relationship between the cell reference (AI2) and the name of the site? Is it a lookup?
 
Upvote 0
What is the relationship between the cell reference (AI2) and the name of the site? Is it a lookup?
Just a straight formula... Formula in AI2 is =SUM(B2:AH2)
 
Upvote 0
You need to lock each cell individually, not lock the 1st one & drag down.
Select the range & use Replace (Ctrl H) to replace AI with AI$
 
Upvote 0
Solution
This doesn't seem like good design to me, but you can include the sheet name in your formula link and it should then sort as you want.
 
Upvote 0
You need to lock each cell individually, not lock the 1st one & drag down.
Select the range & use Replace (Ctrl H) to replace AI with AI$

Thanks Fluff... this works now...
 
Upvote 0

Forum statistics

Threads
1,215,032
Messages
6,122,772
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top