Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How can one set a value TO another cell?

Suppose column A contains a list of dates.

A1 is July 21, 2008
A2 is July 22, 2008
A3 is July 23, 2008

And so on. The dates in column A are determined by a formula, so they
will change from day to day.

Suppose column B contains a list of daily prices.

B1 is $80
B2 is $90
B3 is $100

And so on. The prices in column B are determined by a formula, so
they will change from day to day.

Suppose column C contains a formula that calculates the data in column
B. The first time that formula in column C finds a cell in column B
that exceeds $100, I want it to update cell D1 to contain the date in
column A.

So the formula looks at B1, does a calculation, but is content.
The formula looks at B2, does a calculation, but is content.
The formula looks at B3 and "sees" that B3 exceeds $100 so the formula
tells D1 to inherit the date of A3.

Does that make sense?

I know I can go to cell D1 and type "=A3" but that's not the point.
The cell that contains the correct date may be A4 tomorrow, and A10
the following day. So hard coding D1 to A3 will not work for this
purpose.

I want the formula in column C to "push" the date to D1.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default How can one set a value TO another cell?

Hi blixel,

If you're using colum C to calculate data, then write the following formula
in column D and copy it down:

=IF(B1100,A1)

Hope this helps! ;o)

--
Steffi
********
It''s Thank You and Goodnight! :o) xx


"blixel" wrote:

Suppose column A contains a list of dates.

A1 is July 21, 2008
A2 is July 22, 2008
A3 is July 23, 2008

And so on. The dates in column A are determined by a formula, so they
will change from day to day.

Suppose column B contains a list of daily prices.

B1 is $80
B2 is $90
B3 is $100

And so on. The prices in column B are determined by a formula, so
they will change from day to day.

Suppose column C contains a formula that calculates the data in column
B. The first time that formula in column C finds a cell in column B
that exceeds $100, I want it to update cell D1 to contain the date in
column A.

So the formula looks at B1, does a calculation, but is content.
The formula looks at B2, does a calculation, but is content.
The formula looks at B3 and "sees" that B3 exceeds $100 so the formula
tells D1 to inherit the date of A3.

Does that make sense?

I know I can go to cell D1 and type "=A3" but that's not the point.
The cell that contains the correct date may be A4 tomorrow, and A10
the following day. So hard coding D1 to A3 will not work for this
purpose.

I want the formula in column C to "push" the date to D1.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How can one set a value TO another cell?

On Jun 20, 10:52*am, Stefania
wrote:
Hi blixel,

If you're using colum C to calculate data, then write the followingformula
in column D and copy it down:

=IF(B1100,A1)


Thanks but that won't work in this case unless I want to have over
2,000 nested IF statements in cell D1.

IF(B1100,A1,IF(B2100,A2,IF(B3100,A3))) (And so on * thousands)

What I need is for the formula in column C to "push" the date to D1.
(IF[calculations are true],[SET.D1(A1)])
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default How can one set a value TO another cell?

An Excel function can't put a value in another cell; it just returns a value
to the cell that contains the formula. I think the following array formula in
D1 will do what you want:

=INDIRECT(ADDRESS(MATCH(1,IF(B1:B2000100,1,0),0), 1))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do
it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Hope this helps,

Hutch

"blixel" wrote:

On Jun 20, 10:52 am, Stefania
wrote:
Hi blixel,

If you're using colum C to calculate data, then write the followingformula
in column D and copy it down:

=IF(B1100,A1)


Thanks but that won't work in this case unless I want to have over
2,000 nested IF statements in cell D1.

IF(B1100,A1,IF(B2100,A2,IF(B3100,A3))) (And so on * thousands)

What I need is for the formula in column C to "push" the date to D1.
(IF[calculations are true],[SET.D1(A1)])

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How can one set a value TO another cell?

On Jun 20, 12:34*pm, Tom Hutchins
wrote:
An Excel function can't put a value inanothercell; it just returns a value
to thecellthat contains theformula. I think the following arrayformulain
D1 will do what you want:

=INDIRECT(ADDRESS(MATCH(1,IF(B1:B2000100,1,0),0), 1))

This is an arrayformula. *Hit ctrl-shift-enter instead of enter. *If you do
it
correctly, excel will wrap curly brackets {} around yourformula. *(don't type
them yourself.)

Hope this helps,


Thanks for the reply Tom. That did give some an additional insight
and I played around with a variety of ideas but still can't quite put
it together. I'll further explain what I'm trying to do and maybe you
or someone else can help bring it home for me.

I have a 1 file spreadsheet that has two sheets. The first sheet is
called "Main" and the second sheet is called "Data"

The Main sheet is intended to be an easily readable summary of the
Data sheet. The Data sheet contains 10 columns of data. In column A,
it's the date starting in cell A1 with a date that is equal to a cell
defined on the Main sheet. Then A2 and on done is simply A1+1, +A2+1,
A3+1, and so on. Very simple but it goes on for more than 2,000 rows.

The next important column for the sake of this problem is the %
column. The % column is calculated at 1.3% on a weekday (Monday
through Friday), and a lower percent on the weekend. I figured out
how to easily do this by doing if(mod(weekday(A1),
7)<=1,.005,.013)) ... so if it is a Monday-Friday, the day is
calculated at the higher percentage of 1.3%, if it's Saturday/Sunday,
the day is calculated at 0.05%

I keep track of this column on a daily basis which is just a simple
=sum($C$1:C2) for day two, and =sum($C$1:C3) for day two and so on all
the way down the line. Here is the "trick" ... when the sum of
column C becomes equal or greater than 125%, I need to know the exact
date that occurs on.

So on my Main sheet, in the proper summary cell, I need something like
=indirect(address(if(match($C$1:C2000=125%)[return matching A column
date on that day])))

As a simple example, suppose the following. I'm using larger numbers
to keep the example short.

A1 = July 1, 2008 C1 = 25%
A2 = July 2, 2008 C2 = 25%
A3 = July 3, 2008 C3 = 25%
A4 = July 4, 2008 C4 = 15%
A6 = July 6, 2008 C4 = 15%
A7 = July 7, 2008 C4 = 25%
A8 = July 8, 2008 C4 = 25%

On July 7th, 2008 the total percentage will go to 130% which is over
the requirement. So I need the cell on the Main sheet to pull that
date from A7. Bear in mind that the date for A1 will change depending
on the situation. It's not hard coded. A1 could be any date.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default How can one set a value TO another cell?

Sorry for the long delay responding. You can do this with a user-defined
function:

Public Function ThresholdDate(Rng As Range, Threshold As Double) As Date
Dim c As Range, tmpDate As Date
Dim RunTtl As Double
RunTtl = 0
For Each c In Rng
RunTtl = RunTtl + c.Value
If RunTtl Threshold Then
tmpDate = c.Offset(0, -1).Value
Exit For
End If
Next c
ThresholdDate = tmpDate
End Function

The first argument, Rng, is the collection of percentages in column B on the
Data sheet. The second argument, Threshold, is the cumulative percentage
which, when exceeded, indicates the desired point in the data has been
reached. If the threshold is never attained, the formula returns 0. You would
call it from the Main sheet like this:

=ThresholdDate(Data!B1:B2000,125%) or
=ThresholdDate(Data!B1:B2000,1.25)

Since it returns a serial date value (from column A on the Data sheet), you
will need to format the cell with the formula to look like a date. You could
point the Threshold argument to a cell, so you could change the threshold
argument by changing that cell:

=ThresholdDate(Data!B1:B2000,H1)
where H1 contains 125%.

If you are new to user-defined functions (macros), this link to Jon
Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"blixel" wrote:

On Jun 20, 12:34 pm, Tom Hutchins
wrote:
An Excel function can't put a value inanothercell; it just returns a value
to thecellthat contains theformula. I think the following arrayformulain
D1 will do what you want:

=INDIRECT(ADDRESS(MATCH(1,IF(B1:B2000100,1,0),0), 1))

This is an arrayformula. Hit ctrl-shift-enter instead of enter. If you do
it
correctly, excel will wrap curly brackets {} around yourformula. (don't type
them yourself.)

Hope this helps,


Thanks for the reply Tom. That did give some an additional insight
and I played around with a variety of ideas but still can't quite put
it together. I'll further explain what I'm trying to do and maybe you
or someone else can help bring it home for me.

I have a 1 file spreadsheet that has two sheets. The first sheet is
called "Main" and the second sheet is called "Data"

The Main sheet is intended to be an easily readable summary of the
Data sheet. The Data sheet contains 10 columns of data. In column A,
it's the date starting in cell A1 with a date that is equal to a cell
defined on the Main sheet. Then A2 and on done is simply A1+1, +A2+1,
A3+1, and so on. Very simple but it goes on for more than 2,000 rows.

The next important column for the sake of this problem is the %
column. The % column is calculated at 1.3% on a weekday (Monday
through Friday), and a lower percent on the weekend. I figured out
how to easily do this by doing if(mod(weekday(A1),
7)<=1,.005,.013)) ... so if it is a Monday-Friday, the day is
calculated at the higher percentage of 1.3%, if it's Saturday/Sunday,
the day is calculated at 0.05%

I keep track of this column on a daily basis which is just a simple
=sum($C$1:C2) for day two, and =sum($C$1:C3) for day two and so on all
the way down the line. Here is the "trick" ... when the sum of
column C becomes equal or greater than 125%, I need to know the exact
date that occurs on.

So on my Main sheet, in the proper summary cell, I need something like
=indirect(address(if(match($C$1:C2000=125%)[return matching A column
date on that day])))

As a simple example, suppose the following. I'm using larger numbers
to keep the example short.

A1 = July 1, 2008 C1 = 25%
A2 = July 2, 2008 C2 = 25%
A3 = July 3, 2008 C3 = 25%
A4 = July 4, 2008 C4 = 15%
A6 = July 6, 2008 C4 = 15%
A7 = July 7, 2008 C4 = 25%
A8 = July 8, 2008 C4 = 25%

On July 7th, 2008 the total percentage will go to 130% which is over
the requirement. So I need the cell on the Main sheet to pull that
date from A7. Bear in mind that the date for A1 will change depending
on the situation. It's not hard coded. A1 could be any date.


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
How can I copy a value from a cell and paste it into another cell while adding it to the previous value in that cell [email protected] Excel Worksheet Functions 2 November 7th 07 09:39 AM
How can I make a blank cell in a formula cell with a range of cell Vi Excel Discussion (Misc queries) 5 June 21st 07 02:46 PM
cell data not validated if navigating cell to cell with mouse LoveThatMouse Excel Worksheet Functions 6 May 21st 06 09:03 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM


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