View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.newusers
John C[_2_] John C[_2_] is offline
external usenet poster
 
Posts: 1,358
Default Sort affects formula

One possible solution, is used defined names. Takes a 'little' bit of setup,
but once setup, should be easy to configure. Given your sample data, this is
what I did:
My named ranges a
Column A: Name
Column B: Group
Column C: Weight
Row 1: BBCurls
Row 2: BBExten
Row 3: BBPress
Row 4: BBPull

The easiest way to 'name' the ranges is, for example, click on the A for the
first column (this should select the entire column), and in the formula bar,
to the right of the formula, click in there, and type in the word Name. Do
the same for columns B & C, and click on the row number to highlight the
entire row and name as above. (Note: This assumes your inital presorted
setup).
After you do the naming, your formula in cell D1 would look like this:
D1: =BBExten Weight*0.5
D2: =BBCurls Weight*0.5
D3: =BBPull Weight*0.5
D4: =BBPress Weight*0.5

Then, when the data is sorted, the named ranges get sorted as well, and
therefore your data remains exact.

Hope this helps.
--
** John C **

"Its-Just-Me" wrote:

The table stores exercise data, ie "Barbell Curls (BBCurls)" might be one row
(cell A1), "Barbell Extensions (BBExten)" might be row 2 (cell A2) etcetera.
Each exercise would belong to a set ie "A" (cell B1), "B" (cell B2), (five
exercises to a set) so when sorted on column B the exercises would be sorted
by what set they belong to. When sorted by Column A the exercises would be in
Alphabetical order by name.
Column 'C' might be the maximum weight used in each exercise.
Exercise "Barbell Curls" and "Barbell Extensions" are related because they
are opposites so I would want to be warned when ("Barbell Curls" Maximum
Weight)x0.50 ("Barbell Extensions" Maximum Weight)

BBCurls, A, 100, (=C2*0.5)
BBExten, B, 30, (=C1*0.5)
BBPress, A, 150, (=C4*0.5)
BBPull, B, 100, (=C3*0.5)

I set Conditional Formating on column D to : IF "Cell Value is" "Less than"
"=$D1" THEN Format Red.
It works fine until I sort by 'set' (Column B)

Thanks again.
(Sorry, I'm new to this)

"ShaneDevenshire" wrote:

Without more details, the best I can suggest is make the references absolute
- change =A1 to =A$1

What we really need to know is what's the formula, does it refer to cells in
the data or outside the data.
--
Thanks,
Shane Devenshire


"Its-Just-Me" wrote:

I use Excel to manage records (rows) of data.
Data (a cell) in any given row uses a formula which makes use of data from a
different row. The rows may or may not be sequential.
When I sort the rows the formulas, since the rows change order, they no
longer point to the correct data (cell).
It there a straight forward way of accomplishing this?
Thanks.