ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Introduce Value in a cell with formula, option (https://www.excelbanter.com/excel-discussion-misc-queries/135289-introduce-value-cell-formula-option.html)

Filipemr

Introduce Value in a cell with formula, option
 
I have a column with formulas in cells, but i want sometimes to introduce
values instead having the result of the formula. At the same time i don't
want to loose the formula in the cell. Perhaps a condition that cleans the
formulas and put cells blank?
Thanks!

Bob Phillips

Introduce Value in a cell with formula, option
 
You can't have both. A cell can either have a formula, and displays the
result of that formula, or a value.

You could perhaps change the formula to identify when that value should be
there and return that. For instance, instead of

=SUM(A1:A20)

=IF(B1<"","",SUM(A1:A20))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Filipemr" wrote in message
...
I have a column with formulas in cells, but i want sometimes to introduce
values instead having the result of the formula. At the same time i don't
want to loose the formula in the cell. Perhaps a condition that cleans the
formulas and put cells blank?
Thanks!




Gord Dibben

Introduce Value in a cell with formula, option
 
You can have a formula or a value.........not both.

Typing a value will overwrite the formula.

Perhaps what you want could be achieved through a formula.

=IF(SUM(A1:A10)<1234,5678,SUM(A1:A10))


Gord Dibben MS Excel MVP


On Sat, 17 Mar 2007 14:13:08 -0700, Filipemr
wrote:

I have a column with formulas in cells, but i want sometimes to introduce
values instead having the result of the formula. At the same time i don't
want to loose the formula in the cell. Perhaps a condition that cleans the
formulas and put cells blank?
Thanks!



Filipemr

Introduce Value in a cell with formula, option
 
if i make a list, in the validation of data, that one of the entrie is the
formula, it could result. I've tried but the formula doesn't display. Can it
be possible?

"Gord Dibben" wrote:

You can have a formula or a value.........not both.

Typing a value will overwrite the formula.

Perhaps what you want could be achieved through a formula.

=IF(SUM(A1:A10)<1234,5678,SUM(A1:A10))


Gord Dibben MS Excel MVP


On Sat, 17 Mar 2007 14:13:08 -0700, Filipemr
wrote:

I have a column with formulas in cells, but i want sometimes to introduce
values instead having the result of the formula. At the same time i don't
want to loose the formula in the cell. Perhaps a condition that cleans the
formulas and put cells blank?
Thanks!




Gord Dibben

Introduce Value in a cell with formula, option
 
You could do that using DV and sheet event code.

Assume you have a DV drop-down in B3 with 1, 2, 3, 4, 5 ,6 to choose from.

Choose 4 and the event code will run placing a formula in B3.

Any other number chosen will wipe the formula.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo endit
If Target.Address = "$B$3" And Target.Value = "4" Then
Application.EnableEvents = False
Target.Formula = "=SUM(A2:A10)"
End If
endit:
Application.EnableEvents = True
End Sub


Gord

On Sat, 17 Mar 2007 14:57:00 -0700, Filipemr
wrote:

if i make a list, in the validation of data, that one of the entrie is the
formula, it could result. I've tried but the formula doesn't display. Can it
be possible?

"Gord Dibben" wrote:

You can have a formula or a value.........not both.

Typing a value will overwrite the formula.

Perhaps what you want could be achieved through a formula.

=IF(SUM(A1:A10)<1234,5678,SUM(A1:A10))


Gord Dibben MS Excel MVP


On Sat, 17 Mar 2007 14:13:08 -0700, Filipemr
wrote:

I have a column with formulas in cells, but i want sometimes to introduce
values instead having the result of the formula. At the same time i don't
want to loose the formula in the cell. Perhaps a condition that cleans the
formulas and put cells blank?
Thanks!






All times are GMT +1. The time now is 11:57 PM.

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