Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jim Jim is offline
external usenet poster
 
Posts: 615
Default function to populate a cell where formula is NOT located

I'm using excel 2007.

I'm looking to have a logical test in one cell that will populate a
different cell if true, or a third cell if false.

For example, the logical test located in cell A1: If (A2=3, then Cell B2 =
"True", then Cell B2="RED")

Another variation is to have the value in a cell determine the new cell
location. For example, IF(D1="","", then cell A(Row Number D1)="Populated")


Solutions?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default function to populate a cell where formula is NOT located

In your first example, put a formula in B2 to test the value in A1.
In your second example, you could use a simple event macro to dynamically
test the value in D1 and set the appropriate cell in column A
--
Gary''s Student - gsnu201001


"Jim" wrote:

I'm using excel 2007.

I'm looking to have a logical test in one cell that will populate a
different cell if true, or a third cell if false.

For example, the logical test located in cell A1: If (A2=3, then Cell B2 =
"True", then Cell B2="RED")

Another variation is to have the value in a cell determine the new cell
location. For example, IF(D1="","", then cell A(Row Number D1)="Populated")


Solutions?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jim Jim is offline
external usenet poster
 
Posts: 615
Default function to populate a cell where formula is NOT located

I don't want to put the formulas is the 'destination' cells as that area is
very dynamic. I made an error in my first example, the value of false should
have been 'then Cell C2="Red"'.

I've had a little feedback from another source saying this is most likely
solved by VBA and not in functions or formulas.

"Gary''s Student" wrote:

In your first example, put a formula in B2 to test the value in A1.
In your second example, you could use a simple event macro to dynamically
test the value in D1 and set the appropriate cell in column A
--
Gary''s Student - gsnu201001


"Jim" wrote:

I'm using excel 2007.

I'm looking to have a logical test in one cell that will populate a
different cell if true, or a third cell if false.

For example, the logical test located in cell A1: If (A2=3, then Cell B2 =
"True", then Cell B2="RED")

Another variation is to have the value in a cell determine the new cell
location. For example, IF(D1="","", then cell A(Row Number D1)="Populated")


Solutions?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default function to populate a cell where formula is NOT located

Is a VBA solution acceptable to you? Some posters are "macrophobic"
--
Gary''s Student - gsnu201001


"Jim" wrote:

I don't want to put the formulas is the 'destination' cells as that area is
very dynamic. I made an error in my first example, the value of false should
have been 'then Cell C2="Red"'.

I've had a little feedback from another source saying this is most likely
solved by VBA and not in functions or formulas.

"Gary''s Student" wrote:

In your first example, put a formula in B2 to test the value in A1.
In your second example, you could use a simple event macro to dynamically
test the value in D1 and set the appropriate cell in column A
--
Gary''s Student - gsnu201001


"Jim" wrote:

I'm using excel 2007.

I'm looking to have a logical test in one cell that will populate a
different cell if true, or a third cell if false.

For example, the logical test located in cell A1: If (A2=3, then Cell B2 =
"True", then Cell B2="RED")

Another variation is to have the value in a cell determine the new cell
location. For example, IF(D1="","", then cell A(Row Number D1)="Populated")


Solutions?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default function to populate a cell where formula is NOT located

Let's say we are setting D1 manually. Install the following event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim t As Range
Set t = Target
If Intersect(t, Range("D1")) Is Nothing Then Exit Sub
If t.Value = "" Then Exit Sub
Application.EnableEvents = False
Range("A" & t.Value).Value = "Populated"
Application.EnableEvents = True
End Sub

If you enter 10 in D1, then A10 will be populated, etc.

Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


If D1 contains a formula, then a slightly different macro would be needed.
--
Gary''s Student - gsnu201001


"Jim" wrote:

I don't want to put the formulas is the 'destination' cells as that area is
very dynamic. I made an error in my first example, the value of false should
have been 'then Cell C2="Red"'.

I've had a little feedback from another source saying this is most likely
solved by VBA and not in functions or formulas.

"Gary''s Student" wrote:

In your first example, put a formula in B2 to test the value in A1.
In your second example, you could use a simple event macro to dynamically
test the value in D1 and set the appropriate cell in column A
--
Gary''s Student - gsnu201001


"Jim" wrote:

I'm using excel 2007.

I'm looking to have a logical test in one cell that will populate a
different cell if true, or a third cell if false.

For example, the logical test located in cell A1: If (A2=3, then Cell B2 =
"True", then Cell B2="RED")

Another variation is to have the value in a cell determine the new cell
location. For example, IF(D1="","", then cell A(Row Number D1)="Populated")


Solutions?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default function to populate a cell where formula is NOT located

Formulas on a worksheet cannot push a value into another cell... they can
only display their calculated value (text or number) in the cell they are
located in. Putting formulas in what you refer to as the "destination cell"
and having them determine what should be displayed in there is pretty much
how spreadsheets work. Can you explain what you mean by "that area is very
dynamic" and why you think this means you cannot place your formula there?
Yes, VBA gives you much more flexibility, but from what you have described
so far, I am having trouble seeing why you can't do this with simple
worksheet formulas.

--
Rick (MVP - Excel)



"Jim" wrote in message
...
I don't want to put the formulas is the 'destination' cells as that area
is
very dynamic. I made an error in my first example, the value of false
should
have been 'then Cell C2="Red"'.

I've had a little feedback from another source saying this is most likely
solved by VBA and not in functions or formulas.

"Gary''s Student" wrote:

In your first example, put a formula in B2 to test the value in A1.
In your second example, you could use a simple event macro to dynamically
test the value in D1 and set the appropriate cell in column A
--
Gary''s Student - gsnu201001


"Jim" wrote:

I'm using excel 2007.

I'm looking to have a logical test in one cell that will populate a
different cell if true, or a third cell if false.

For example, the logical test located in cell A1: If (A2=3, then Cell
B2 =
"True", then Cell B2="RED")

Another variation is to have the value in a cell determine the new cell
location. For example, IF(D1="","", then cell A(Row Number
D1)="Populated")


Solutions?


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default function to populate a cell where formula is NOT located

Hello Jim,

One possible approach might be a conditional format.

The Excel help will give you more detailed information on this.

Regards,
Bernd
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
Utilizing a Cell even with a Formula located inside it Ahh, Excel's Tough Excel Worksheet Functions 4 July 3rd 07 01:13 AM
Search in excel by date located in a cell Btobin0 Excel Discussion (Misc queries) 6 May 27th 06 03:20 PM
function to populate different cell Mike Excel Worksheet Functions 0 April 17th 06 05:55 AM
How do I populate a worksheet name in a formula using a cell ref. Badger Excel Discussion (Misc queries) 1 February 6th 06 09:37 PM
How to populate column with formula based on value in cell Cameron Stewart Excel Worksheet Functions 2 November 2nd 04 01:36 AM


All times are GMT +1. The time now is 12:25 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"