Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Variable column reference in formula

I am trying to use a variable column reference in a formula. Here is an
example:

=SUM(H12:R12) where R can vary depending on the value in cell A4 on the same
spreadsheet

I have tried using INDIRECT and OFFSET but I must have the syntax wrong as
excel keeps flagging the formula with errors. Can someone please translate
the formula above to one with a variable in place of the "R" reference again
contingient on the value of cell A4.

THANK YOU!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Variable column reference in formula

Try this:

=SUM(INDIRECT("H12:"&A4&"12"))

Hope this helps.

Pete

On Jan 16, 12:22*am, excel help acct
wrote:
I am trying to use a variable column reference in a formula. *Here is an
example:

=SUM(H12:R12) where R can vary depending on the value in cell A4 on the same
spreadsheet

I have tried using INDIRECT and OFFSET but I must have the syntax wrong as
excel keeps flagging the formula with errors. *Can someone please translate
the formula above to one with a variable in place of the "R" reference again
contingient on the value of cell A4.

THANK YOU!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 367
Default Variable column reference in formula

Indirect should work fine:

=sum(indirect("H12:" & A2 & "12"))

where you enter your letter in A2

cheers
Carlo

On Jan 16, 9:22*am, excel help acct
wrote:
I am trying to use a variable column reference in a formula. *Here is an
example:

=SUM(H12:R12) where R can vary depending on the value in cell A4 on the same
spreadsheet

I have tried using INDIRECT and OFFSET but I must have the syntax wrong as
excel keeps flagging the formula with errors. *Can someone please translate
the formula above to one with a variable in place of the "R" reference again
contingient on the value of cell A4.

THANK YOU!


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
XL how to change a cell reference in a formula to variable value? Bernard Excel Worksheet Functions 6 June 18th 07 09:22 AM
variable text value within string formula required to sum column Tester Excel Worksheet Functions 2 December 8th 06 01:07 PM
how do I use variable column and rows using other cell reference . Bomber Excel Worksheet Functions 2 July 15th 05 06:39 PM
reference cell value from fixed column with variable row bob z Excel Discussion (Misc queries) 0 May 23rd 05 11:30 PM
how to create a variable column in cell reference Sampson Excel Worksheet Functions 3 February 21st 05 10:13 PM


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