Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Calculating the value of a cell from another cell

I am interesting in how I would go about creating a value for a cell
by referencing it from another cell. I know this logic doesn't work
in Excel, but it makes sense to me...

(Function connected with cell C2) IF(C21,C3=1,C3="")

If this worked then the user could also manually override the value in
C3.

If I placed the function above into the Cell C3 I loose the ability
for the user to hand-enter values into C3 without corrupting the
function.

Is this possible?

Thank you to anyone who may respond!

Greg
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Calculating the value of a cell from another cell

Let's say that the user entered values into cell G3 and that these
took precedence over anything else. Then in C3 you could have the
formula:

=IF(G3<"",G3,IF(C21,1,""))

This way your formula in C3 is intact (and could be protected to
prevent it being over-written), but your user still has the ability to
manually specify another value to be used.

Hope this helps.

Pete

On Jul 29, 11:04*pm, wrote:
I am interesting in how I would go about creating a value for a cell
by referencing it from another cell. *I know this logic doesn't work
in Excel, but it makes sense to me...

(Function connected with cell C2) IF(C21,C3=1,C3="")

If this worked then the user could also manually override the value in
C3.

If I placed the function above into the Cell C3 I loose the ability
for the user to hand-enter values into C3 without corrupting the
function.

Is this possible?

Thank you to anyone who may respond!

Greg


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Calculating the value of a cell from another cell

You cannot push a value from C2 to C3, you must pull from C2 to C3 by using
a formula in C3

Cells can have a formula or a manually entered value, not both.

You could employ event code to place a value in C3 based upon value in C2

You could then override that value in C3 by manual entry so you could have
either value.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("C2")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Range("C3")
Select Case Target.Value
Case 1
.Value = Target.Value
Case Else
.Value = ""
End Select
End With
CleanUp:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-clcik on the sheet tab and "View Code"

Copy/paste the code into that sheet module.

Then Alt + q to return to Excel window.

Type a number in C2 and see C3 either 1 or nothing

Type a number in C3 to see that number.


Gord Dibben MS Excel MVP
On Tue, 29 Jul 2008 15:04:24 -0700 (PDT), wrote:

I am interesting in how I would go about creating a value for a cell
by referencing it from another cell. I know this logic doesn't work
in Excel, but it makes sense to me...

(Function connected with cell C2) IF(C21,C3=1,C3="")

If this worked then the user could also manually override the value in
C3.

If I placed the function above into the Cell C3 I loose the ability
for the user to hand-enter values into C3 without corrupting the
function.

Is this possible?

Thank you to anyone who may respond!

Greg


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
Calculating a cell within a cell navin Excel Discussion (Misc queries) 2 January 5th 07 06:22 PM
Calculating from last inputted cell Petermac New Users to Excel 3 May 31st 06 02:11 PM
Calculating two numbers in one cell chefcasey Excel Worksheet Functions 9 September 13th 05 11:12 PM
calculating from last inputted cell DAShields Excel Discussion (Misc queries) 5 March 3rd 05 08:01 PM
after calculating, round a cell value C Excel Worksheet Functions 3 January 11th 05 08:12 PM


All times are GMT +1. The time now is 09:39 PM.

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

About Us

"It's about Microsoft Excel"