ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Replacing a value from a formula (https://www.excelbanter.com/excel-programming/291369-replacing-value-formula.html)

Squid[_2_]

Replacing a value from a formula
 
Hello:

I have a workbook that has 3 sheets. Summary sheet,
detail sheet and the 3rd is used to list info used by
vlookups (called contracts). I have code that if in the
total of the dues column of the detail sheet is equal to
zero, use the formula in H10, else paste the total in H10.

I need additional code now to change the lookup value in
cell F10 to read 4F Dues. I cannot change the source
info from the lookup list. Does anyone have any ideas
how to do this?

Formulas in summary sheet if dues=0:
F10: =VLOOKUP(VALUE($C$9),Contracts!A1:AI27,14,TRUE)
G10: =VLOOKUP(VALUE($C$9),Contracts!A1:AI27,15,TRUE)
H10: =ROUND(H35*$C$27,2)

Displayed as:
C27: 100.00
F10: 4G Dues
G10: 3.00%
H10: 3.00

Formulas in summary sheet if dues<0:
F10: =VLOOKUP(VALUE($C$9),Contracts!A1:AI27,14,TRUE)
G10: =VLOOKUP(VALUE($C$9),Contracts!A1:AI27,15,TRUE)
H10: 50.00

Should be Displayed as:
C27: 100.00
F10: 4F Dues
G10: 3.00%
H10: 50.00

Squid[_3_]

Replacing a value from a formula
 
Never mind, I figured it out... Replace Function did the trick.

"Squid" wrote in message
...
Hello:

I have a workbook that has 3 sheets. Summary sheet,
detail sheet and the 3rd is used to list info used by
vlookups (called contracts). I have code that if in the
total of the dues column of the detail sheet is equal to
zero, use the formula in H10, else paste the total in H10.

I need additional code now to change the lookup value in
cell F10 to read 4F Dues. I cannot change the source
info from the lookup list. Does anyone have any ideas
how to do this?

Formulas in summary sheet if dues=0:
F10: =VLOOKUP(VALUE($C$9),Contracts!A1:AI27,14,TRUE)
G10: =VLOOKUP(VALUE($C$9),Contracts!A1:AI27,15,TRUE)
H10: =ROUND(H35*$C$27,2)

Displayed as:
C27: 100.00
F10: 4G Dues
G10: 3.00%
H10: 3.00

Formulas in summary sheet if dues<0:
F10: =VLOOKUP(VALUE($C$9),Contracts!A1:AI27,14,TRUE)
G10: =VLOOKUP(VALUE($C$9),Contracts!A1:AI27,15,TRUE)
H10: 50.00

Should be Displayed as:
C27: 100.00
F10: 4F Dues
G10: 3.00%
H10: 50.00





All times are GMT +1. The time now is 02:49 PM.

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