Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Wmm Wmm is offline
external usenet poster
 
Posts: 3
Default How to concatenate text into a formula?

Is there a way to use a formula as the ending cell reference to the AVERAGE
function?

If not, how can I build a formula through concatenation and have it execute?
Here is my example. I use MATCH to find the first column with the value
"Forecast", then back up to the previous column (-1) to get the ending column
for the average function.
=CONCATENATE("=AVERAGE(A1:",ADDRESS(2,MATCH("Forec ast",A2:C2,0)-1),")")

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 265
Default How to concatenate text into a formula?

In article ,
Wmm wrote:

Is there a way to use a formula as the ending cell reference to the AVERAGE
function?

If not, how can I build a formula through concatenation and have it execute?
Here is my example. I use MATCH to find the first column with the value
"Forecast", then back up to the previous column (-1) to get the ending column
for the average function.
=CONCATENATE("=AVERAGE(A1:",ADDRESS(2,MATCH("Forec ast",A2:C2,0)-1),")")



Somewhat unclear... Can you post a small sample of the data, along with
the expected result?

--
Domenic
Microsoft Excel MVP
www.xl-central.com
Your Quick Reference to Excel Solutions
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default How to concatenate text into a formula?

It sounds as if you want the INDIRECT function (see Excel help)
--
David Biddulph

"Wmm" wrote in message
...
Is there a way to use a formula as the ending cell reference to the
AVERAGE
function?

If not, how can I build a formula through concatenation and have it
execute?
Here is my example. I use MATCH to find the first column with the value
"Forecast", then back up to the previous column (-1) to get the ending
column
for the average function.
=CONCATENATE("=AVERAGE(A1:",ADDRESS(2,MATCH("Forec ast",A2:C2,0)-1),")")



  #4   Report Post  
Posted to microsoft.public.excel.misc
Wmm Wmm is offline
external usenet poster
 
Posts: 3
Default How to concatenate text into a formula?

Sample Data:
A1 = ""
B1 = ""
C1 = "Forecast"
....
A2 = 1
B2 = 2
C2 = 3
....

I want to average the numbers in row 2 where row 1 does not contain
"Forecast". This are monthly numbers, so once "Forecast" is encountered in
row 1, the previous column will represent the end of the range to be AVERAGEd.

I don't think the INDIRECT function applies here because I'm not looking for
the cell contents. I'm trying to find a way to dynamically change the
AVERAGE range, and I can't find a way to let one of the parameters of the
AVERAGE function be another function.



"Domenic" wrote:

In article ,
Wmm wrote:

Is there a way to use a formula as the ending cell reference to the AVERAGE
function?

If not, how can I build a formula through concatenation and have it execute?
Here is my example. I use MATCH to find the first column with the value
"Forecast", then back up to the previous column (-1) to get the ending column
for the average function.
=CONCATENATE("=AVERAGE(A1:",ADDRESS(2,MATCH("Forec ast",A2:C2,0)-1),")")



Somewhat unclear... Can you post a small sample of the data, along with
the expected result?

--
Domenic
Microsoft Excel MVP
www.xl-central.com
Your Quick Reference to Excel Solutions

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 265
Default How to concatenate text into a formula?

Try...

=AVERAGE(A2:INDEX(A2:C2,MATCH("Forecast",$A$1:$C$1 ,0)-1))

--
Domenic
Microsoft Excel MVP
www.xl-central.com
Your Quick Reference to Excel Solutions

In article ,
Wmm wrote:

Sample Data:
A1 = ""
B1 = ""
C1 = "Forecast"
...
A2 = 1
B2 = 2
C2 = 3
...

I want to average the numbers in row 2 where row 1 does not contain
"Forecast". This are monthly numbers, so once "Forecast" is encountered in
row 1, the previous column will represent the end of the range to be
AVERAGEd.

I don't think the INDIRECT function applies here because I'm not looking for
the cell contents. I'm trying to find a way to dynamically change the
AVERAGE range, and I can't find a way to let one of the parameters of the
AVERAGE function be another function.



"Domenic" wrote:

In article ,
Wmm wrote:

Is there a way to use a formula as the ending cell reference to the
AVERAGE
function?

If not, how can I build a formula through concatenation and have it
execute?
Here is my example. I use MATCH to find the first column with the value
"Forecast", then back up to the previous column (-1) to get the ending
column
for the average function.
=CONCATENATE("=AVERAGE(A1:",ADDRESS(2,MATCH("Forec ast",A2:C2,0)-1),")")



Somewhat unclear... Can you post a small sample of the data, along with
the expected result?

--
Domenic
Microsoft Excel MVP
www.xl-central.com
Your Quick Reference to Excel Solutions



  #6   Report Post  
Posted to microsoft.public.excel.misc
Wmm Wmm is offline
external usenet poster
 
Posts: 3
Default How to concatenate text into a formula?

That did it! Thank you so much for the help.

"Domenic" wrote:

Try...

=AVERAGE(A2:INDEX(A2:C2,MATCH("Forecast",$A$1:$C$1 ,0)-1))

--
Domenic
Microsoft Excel MVP
www.xl-central.com
Your Quick Reference to Excel Solutions

In article ,
Wmm wrote:

Sample Data:
A1 = ""
B1 = ""
C1 = "Forecast"
...
A2 = 1
B2 = 2
C2 = 3
...

I want to average the numbers in row 2 where row 1 does not contain
"Forecast". This are monthly numbers, so once "Forecast" is encountered in
row 1, the previous column will represent the end of the range to be
AVERAGEd.

I don't think the INDIRECT function applies here because I'm not looking for
the cell contents. I'm trying to find a way to dynamically change the
AVERAGE range, and I can't find a way to let one of the parameters of the
AVERAGE function be another function.



"Domenic" wrote:

In article ,
Wmm wrote:

Is there a way to use a formula as the ending cell reference to the
AVERAGE
function?

If not, how can I build a formula through concatenation and have it
execute?
Here is my example. I use MATCH to find the first column with the value
"Forecast", then back up to the previous column (-1) to get the ending
column
for the average function.
=CONCATENATE("=AVERAGE(A1:",ADDRESS(2,MATCH("Forec ast",A2:C2,0)-1),")")


Somewhat unclear... Can you post a small sample of the data, along with
the expected result?

--
Domenic
Microsoft Excel MVP
www.xl-central.com
Your Quick Reference to Excel Solutions


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
Formula needed to concatenate text with result from calculation Mgville Excel Discussion (Misc queries) 1 February 13th 09 02:48 PM
Concatenate text cell and formula cell result GoinCrazy Excel Worksheet Functions 4 November 26th 08 04:27 PM
CONCATENATE text formula Lauren Excel Worksheet Functions 7 January 7th 06 10:24 PM
Using Concatenate function to generate text in Text Box Mary S. Charts and Charting in Excel 1 December 14th 05 08:55 PM
Can I concatenate text in cells to make a working formula? Matt S. R. Excel Discussion (Misc queries) 11 November 11th 05 03:44 PM


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