Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Use index function to return formula

In my spreadsheet I have two values which lead to a certain formula, the type
code and shape code to be specific. Like I said these values lead to a
formula, the formula itself refers to a set of cells in the same row with
values which are different per situation and need to be completed by the user.

Firstly how do I return a formula refering to column number (row number is
dependent on the row you are in.

Example for row 20
type code 8
shape code 15
Formula =P?? + Q?? - R?? * 8
(because we are in row 20 it becomes P20+Q20-R20*8)

Secondly:
Depending on the shape code (between 1-99) it determines how manny
additional values are needed for the formula, or formula itself
Can excel automatically shade the cells which need values?
For example Shape code 4 needs value A,B and C
Shape code 3 only needs value A
Shape code 92 needs value A,B,C,D and E


Thanks,

Willem
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,104
Default Use index function to return formula

First part:
=INDIRECT("P"&ROW())+INDIRECT("Q"&ROW())-INDIRECT("R"&ROW())*8

Second part: please look in Help under 'Conditional Formatting' then come
back with more questions. Tell us what cell will hold the value of 'shape
type'
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"willemeulen" wrote in message
...
In my spreadsheet I have two values which lead to a certain formula, the
type
code and shape code to be specific. Like I said these values lead to a
formula, the formula itself refers to a set of cells in the same row with
values which are different per situation and need to be completed by the
user.

Firstly how do I return a formula refering to column number (row number is
dependent on the row you are in.

Example for row 20
type code 8
shape code 15
Formula =P?? + Q?? - R?? * 8
(because we are in row 20 it becomes P20+Q20-R20*8)

Secondly:
Depending on the shape code (between 1-99) it determines how manny
additional values are needed for the formula, or formula itself
Can excel automatically shade the cells which need values?
For example Shape code 4 needs value A,B and C
Shape code 3 only needs value A
Shape code 92 needs value A,B,C,D and E


Thanks,

Willem



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default Use index function to return formula

Hi:

You can use the indirect or offset functions.

The indirect is =INDIRECT("P" & ROW())

The offset is =OFFSET(A1, ROW()-1, 15)

or if you do not know the number try

=OFFSET(A1, ROW()-1, column("P1")-1)
--
Hope this helps
Martin Fishlock, www.nyfconsultants.com, Wolverhampton, UK
Please do not forget to rate this reply.


"willemeulen" wrote:

In my spreadsheet I have two values which lead to a certain formula, the type
code and shape code to be specific. Like I said these values lead to a
formula, the formula itself refers to a set of cells in the same row with
values which are different per situation and need to be completed by the user.

Firstly how do I return a formula refering to column number (row number is
dependent on the row you are in.

Example for row 20
type code 8
shape code 15
Formula =P?? + Q?? - R?? * 8
(because we are in row 20 it becomes P20+Q20-R20*8)

Secondly:
Depending on the shape code (between 1-99) it determines how manny
additional values are needed for the formula, or formula itself
Can excel automatically shade the cells which need values?
For example Shape code 4 needs value A,B and C
Shape code 3 only needs value A
Shape code 92 needs value A,B,C,D and E


Thanks,

Willem

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Use index function to return formula

Hi Willem

An alternative, non-volatile formula would be
=INDEX(P:P,ROW())+INDEX(Q:Q,ROW())-(INDEX(R:R,ROW())*8)

--
Regards
Roger Govier

"willemeulen" wrote in message
...
In my spreadsheet I have two values which lead to a certain formula, the
type
code and shape code to be specific. Like I said these values lead to a
formula, the formula itself refers to a set of cells in the same row with
values which are different per situation and need to be completed by the
user.

Firstly how do I return a formula refering to column number (row number is
dependent on the row you are in.

Example for row 20
type code 8
shape code 15
Formula =P?? + Q?? - R?? * 8
(because we are in row 20 it becomes P20+Q20-R20*8)

Secondly:
Depending on the shape code (between 1-99) it determines how manny
additional values are needed for the formula, or formula itself
Can excel automatically shade the cells which need values?
For example Shape code 4 needs value A,B and C
Shape code 3 only needs value A
Shape code 92 needs value A,B,C,D and E


Thanks,

Willem


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
Array formula on INDEX function not working vsoler Excel Worksheet Functions 8 June 3rd 07 07:14 PM
Using INDEX function to return array row. RBI Excel Worksheet Functions 1 October 4th 06 03:21 PM
INDEX function need to have col reference to be formula Pierre Excel Worksheet Functions 2 July 31st 06 09:54 PM
Index? Match? Function to sort and return value fr diff column in Smurfette Excel Worksheet Functions 6 April 27th 06 05:46 PM
Error Return Value from and INDEX(A:2,MATCH()) function BJ Excel Worksheet Functions 4 January 26th 05 02:59 PM


All times are GMT +1. The time now is 01:22 AM.

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"