conditional change of column reference in formulas

  • Thread starter Thread starter excel help acct
  • Start date Start date
E

excel help acct

Is there a way to conditionally change all column references in formulas on a
worksheet depending on a value entered in one field.

Example:
1. In Cell A1 the user enters "peanuts"
2. You do a lookup on "peanuts" and find the column associated w/peanuts is C
3. Now you need to change all formulas which reference the previous column
reference to column C to get the correct figures for the spreadhseet

Can a macro be written to do this for a spreadhseet or even an entire
workbook? If so what would be some sample code? Any other means to go about
this? Is it even possible to do this in excel?

THANKS!
 
You can use a combination of match ,address and index to address the
conditional formula change if you dont have too many formulae as shown
below

peanut
3 5 4
cashew peanut walnut
=INDIRECT(ADDRESS(2,MATCH(A1,A3:E3,0),4))

HTH

Regards
Anirudh
 

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

Back
Top