question about cell reference in a formula

K

kelie.feng

Hello,

I have this formula for a cell:
SUM(INDIRECT("C"&A18):INDIRECT("C"&B18))

How can I dynamially reference the column in which the cell is in,
rather than using "C", as shown above?

Thank you.

Kelie
 
B

Bryan Hessey

Hi,

I'm not sure I understand your question, do you mean to put a C in A1
and a D in cell A17 and do:

=SUM(INDIRECT(A16&A18):INDIRECT(A17&B18))

(which also adds column D to your column C total)

--
 
K

kelie.feng

Bryan,

Thanks for your reply. Right now the formula is for cell in column C,
but it could be in column D, E, etc., and in which cases, I want the
formula to be
SUM(INDIRECT("D"&A18):INDIRECT("D"&B18)) and
SUM(INDIRECT("E"&A18):INDIRECT("E"&B18))
without having to manually change the formula. In other words, the
formula needs to detect which column the cell is in. Did I explain a
little better this time?

Kelie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top