I need help with an Excel "table" formula

N

ND Pard

I have the formula:

=SUMIF(InStateTravel[Dept ID],$A$2,InStateTravel[Meals])

in my worksheet that works fine.

Howerver, the field: "Meals", is also the value of cell A11 on the same
worksheet.
Further, all the cells below A11 are the value of other fields in the table:
InStateTravel.

Is it possible to write the formula so I can just copy it down?

For example: cell A12 has a value of "Lodging"; unfortunately, when I copy
the formula down, it still refers to the field [Meals]. I would like it to
refer to the field [Lodging].

Thanks in advance.
 
B

Bob Phillips

Is this what you mean?

=SUMIF(InStateTravel[Dept ID],$A$2,INDIRECT("InStateTravel["&A11&"]"))
 
N

ND Pard

Thank you Bob Phillips.

It works like a charm ...

I had tried using the Indirect function, but had written it incorrectly.

You're a genius!!!

THANK YOU! THANK YOU! THANK YOU!
 

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