ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   calculate formula of another cell (https://www.excelbanter.com/excel-worksheet-functions/173203-calculate-formula-another-cell.html)

sweetpeach

calculate formula of another cell
 
I need for one cell to use the formula inputted on another cell under a
certain condition.
Here is the 1st formula:
=IF(AND($C$6=75%),'Dept acc'!H69,IF(AND($C$6=50%),'Dept
acc'!H65,IF(AND($C$6=25%),'Dept acc'!H61,'Dept acc'!H73)))

In the dept acc H69 cell is the following formula:
=IF(AND(B69<=1802.25),1,IF(AND(B69=1802.26,B69<=3 602.25),2,
IF(AND(B69=3602.26,B69<=5402.25),3, IF(AND(B69=5402.26,B69<=7202.25),4,
IF(AND(B69=7202.26),5)))))

I need for the computer to calculate the formula in H69 cell when that $C$6
is 75% and another formula when $C$6 is 50% etc..

Tyro[_2_]

calculate formula of another cell
 
The AND function computes 2 or more things that have to be true to produce
true. You have only one thing - e.g. AND($C$6=75%) and what???
For example if I want to have a three cells be 3, 4, 5 I could say
=AND(A1=3,B1=4,C1=5) that would mean that cells A1 must be 3, B1 must be 4
and C1 must be 5 for the condition to be true. Your formula makes no sense.
=IF(AND(1=1), true, false) You are AND'ing nothing.

Tyro

"sweetpeach" wrote in message
...
I need for one cell to use the formula inputted on another cell under a
certain condition.
Here is the 1st formula:
=IF(AND($C$6=75%),'Dept acc'!H69,IF(AND($C$6=50%),'Dept
acc'!H65,IF(AND($C$6=25%),'Dept acc'!H61,'Dept acc'!H73)))

In the dept acc H69 cell is the following formula:
=IF(AND(B69<=1802.25),1,IF(AND(B69=1802.26,B69<=3 602.25),2,
IF(AND(B69=3602.26,B69<=5402.25),3, IF(AND(B69=5402.26,B69<=7202.25),4,
IF(AND(B69=7202.26),5)))))

I need for the computer to calculate the formula in H69 cell when that
$C$6
is 75% and another formula when $C$6 is 50% etc..




ShaneDevenshire

calculate formula of another cell
 
Before I deal with your problem, let's look at the basic formula
constructions - the first formula should be reduced to something like:

=IF($C$6=75%,'Dept acc'!H69,IF($C$6=50%,'Dept acc'!H65,IF($C$6=25%,'Dept
acc'!H61,'Dept acc'!H73)))

and the second formula:

=IF(B69<=1802.25,1,IF(AND(B69=1802.26,B69<=3602.2 5),2,
IF(AND(B69=3602.26,B69<=5402.25),3, IF(AND(B69=5402.26,B69<=7202.25),4,
IF(B69=7202.26,5)))))

better yet would be to replace the multiple IF's with one
VLOOKUP(B69,Table,2) where Table is a two column range looking like this:
0 1
1802.25 2
3602.25 3
5402.25 4
7202.25 5

Now to your problem a formula can't control which cells calculate. You
could do that with VBA if you put the spreadsheet in manual recalc mode.

This is certainly a non-standard use of the spreadsheet, maybe it would be
better to have other formulas use the results of different cells based on the
result in C6. If it is 75% use the results in X1, if 50% use the results in
X2, and so on.

--
Cheers,
Shane Devenshire


"sweetpeach" wrote:

I need for one cell to use the formula inputted on another cell under a
certain condition.
Here is the 1st formula:
=IF(AND($C$6=75%),'Dept acc'!H69,IF(AND($C$6=50%),'Dept
acc'!H65,IF(AND($C$6=25%),'Dept acc'!H61,'Dept acc'!H73)))

In the dept acc H69 cell is the following formula:
=IF(AND(B69<=1802.25),1,IF(AND(B69=1802.26,B69<=3 602.25),2,
IF(AND(B69=3602.26,B69<=5402.25),3, IF(AND(B69=5402.26,B69<=7202.25),4,
IF(AND(B69=7202.26),5)))))

I need for the computer to calculate the formula in H69 cell when that $C$6
is 75% and another formula when $C$6 is 50% etc..



All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com