Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Zuohong
 
Posts: n/a
Default change operating cells dynamically according to the value of a fixed cell

Hi all,

I'm experiencing a tough MS excel function problem. Please give me
some advices.

-------------------------------------
a b c d
1 3 9 50
2 10 8 40
3 7 30
4 6 20
5 5 10
.. . .
.. . .
.. . .
-------------------------------------

I need to put my results in column D. Currently, D1 should euqal to
"if(C1-SUM(B1:B3)C3,C1-B1,C1-B1+$A$2)". That means I need to make a
justification that whether C1 is bigger than the summary of B1 to B3.
If it's smaller than the sum, I need to add a constant($A$2) to D1
while reducing B1. Then D2=if(C2-SUM(B2:B4)C4,C2-B2,C2-B2+$A$2), and
so on.
But, the problem is that the $A$1=3 is NOT a constant number!!! For
different products, this A1 is different. Perhaps it's 6 sometimes, so
the D1 changes to "if(C1-SUM(B1:B6)C6,C1-B1,C1-B1+$A$2)". Since
there're hundreds of cases to deal with, certainly I don't want to
change the formulas again and again.

To be explicit, I need to change the formulas in column D, according
to the value of $A$1. If
$A$1=3,D1="if(C1-SUM(B1:B3)C3,C1-B1,C1-B1+$A$2)",
D2="if(C2-SUM(B2:B4)C4,C2-B2,C2-B2+$A$2)"...
When $A$1=4, D1="if(C1-SUM(B1:B4)C4,C1-B1,C1-B1+$A$2)",
D2="if(C2-SUM(B2:B5)C5,C2-B2,C2-B2+$A$2)"...

To be more simplified, I need to firstly get the value of $A$1, for
example $A$1=6, then I cite this value to be a mark for another cell,
for instance, $B$6. But it's NOT always 6, it's changing according to
different $A$1. However, I tried to adopt something like $B$($A$1),
but it's not possible.

Would you please help me to resolve the trouble? Thank you very much.

zh.y
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

zh.y,

You could try (along the lines of your idea of using $B$($A$1)

INDIRECT("$B$" & $A$1)

HTH,
Bernie
MS Excel MVP

"Zuohong" wrote in message
om...
Hi all,

I'm experiencing a tough MS excel function problem. Please give me
some advices.

-------------------------------------
a b c d
1 3 9 50
2 10 8 40
3 7 30
4 6 20
5 5 10
. . .
. . .
. . .
-------------------------------------

I need to put my results in column D. Currently, D1 should euqal to
"if(C1-SUM(B1:B3)C3,C1-B1,C1-B1+$A$2)". That means I need to make a
justification that whether C1 is bigger than the summary of B1 to B3.
If it's smaller than the sum, I need to add a constant($A$2) to D1
while reducing B1. Then D2=if(C2-SUM(B2:B4)C4,C2-B2,C2-B2+$A$2), and
so on.
But, the problem is that the $A$1=3 is NOT a constant number!!! For
different products, this A1 is different. Perhaps it's 6 sometimes, so
the D1 changes to "if(C1-SUM(B1:B6)C6,C1-B1,C1-B1+$A$2)". Since
there're hundreds of cases to deal with, certainly I don't want to
change the formulas again and again.

To be explicit, I need to change the formulas in column D, according
to the value of $A$1. If
$A$1=3,D1="if(C1-SUM(B1:B3)C3,C1-B1,C1-B1+$A$2)",
D2="if(C2-SUM(B2:B4)C4,C2-B2,C2-B2+$A$2)"...
When $A$1=4, D1="if(C1-SUM(B1:B4)C4,C1-B1,C1-B1+$A$2)",
D2="if(C2-SUM(B2:B5)C5,C2-B2,C2-B2+$A$2)"...

To be more simplified, I need to firstly get the value of $A$1, for
example $A$1=6, then I cite this value to be a mark for another cell,
for instance, $B$6. But it's NOT always 6, it's changing according to
different $A$1. However, I tried to adopt something like $B$($A$1),
but it's not possible.

Would you please help me to resolve the trouble? Thank you very much.

zh.y



  #3   Report Post  
Zuohong
 
Posts: n/a
Default

Hey Bernie, thank you for the great help. Now I could continue my thinking.

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message ...
zh.y,

You could try (along the lines of your idea of using $B$($A$1)

INDIRECT("$B$" & $A$1)

HTH,
Bernie
MS Excel MVP

"Zuohong" wrote in message
om...
Hi all,

I'm experiencing a tough MS excel function problem. Please give me
some advices.

-------------------------------------
a b c d
1 3 9 50
2 10 8 40
3 7 30
4 6 20
5 5 10
. . .
. . .
. . .
-------------------------------------

I need to put my results in column D. Currently, D1 should euqal to
"if(C1-SUM(B1:B3)C3,C1-B1,C1-B1+$A$2)". That means I need to make a
justification that whether C1 is bigger than the summary of B1 to B3.
If it's smaller than the sum, I need to add a constant($A$2) to D1
while reducing B1. Then D2=if(C2-SUM(B2:B4)C4,C2-B2,C2-B2+$A$2), and
so on.
But, the problem is that the $A$1=3 is NOT a constant number!!! For
different products, this A1 is different. Perhaps it's 6 sometimes, so
the D1 changes to "if(C1-SUM(B1:B6)C6,C1-B1,C1-B1+$A$2)". Since
there're hundreds of cases to deal with, certainly I don't want to
change the formulas again and again.

To be explicit, I need to change the formulas in column D, according
to the value of $A$1. If
$A$1=3,D1="if(C1-SUM(B1:B3)C3,C1-B1,C1-B1+$A$2)",
D2="if(C2-SUM(B2:B4)C4,C2-B2,C2-B2+$A$2)"...
When $A$1=4, D1="if(C1-SUM(B1:B4)C4,C1-B1,C1-B1+$A$2)",
D2="if(C2-SUM(B2:B5)C5,C2-B2,C2-B2+$A$2)"...

To be more simplified, I need to firstly get the value of $A$1, for
example $A$1=6, then I cite this value to be a mark for another cell,
for instance, $B$6. But it's NOT always 6, it's changing according to
different $A$1. However, I tried to adopt something like $B$($A$1),
but it's not possible.

Would you please help me to resolve the trouble? Thank you very much.

zh.y

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change a cell's fill color dynamically? Arlen Excel Discussion (Misc queries) 2 January 22nd 05 09:51 PM
How do I link many cells to one particular cell? fish@divi Excel Discussion (Misc queries) 2 January 4th 05 11:00 PM
How do I link many cells to one particular cell? justinfishman22 Excel Discussion (Misc queries) 2 January 4th 05 12:09 AM
Heps to design Locked/Unlocked cells in protected worksheet Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:09 AM
How to change the width on individual cells TemporarilyConfused Excel Worksheet Functions 1 November 10th 04 07:34 PM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"