Solved

Maintaining References in Excel Formulas

Posted on 2012-03-18
1
353 Views
Last Modified: 2012-03-18
In my Excel worksheet, I have a formula that looks like this:

=IF(P25=1, LOOKUP(B6,AH4:AH7,AJ4:AJ7),LOOKUP(P25,AH4:AH7,AJ4:AJ7))

I've copied it to about 8 new rows, and changed the relevant references to point to the appropriate rows, so I now have this:

=IF(P26=1, LOOKUP(B6,AH4:AH7,AJ4:AJ7),LOOKUP(P25,AH4:AH7,AJ4:AJ7))
=IF(P27=1, LOOKUP(B6,AH4:AH7,AJ4:AJ7),LOOKUP(P27,AH4:AH7,AJ4:AJ7))
=IF(P28=1, LOOKUP(B6,AH4:AH7,AJ4:AJ7),LOOKUP(P28,AH4:AH7,AJ4:AJ7))
=IF(P29=1, LOOKUP(B6,AH4:AH7,AJ4:AJ7),LOOKUP(P29,AH4:AH7,AJ4:AJ7))
=IF(P30=1, LOOKUP(B6,AH4:AH7,AJ4:AJ7),LOOKUP(P30,AH4:AH7,AJ4:AJ7))

Those forumlas work, and leave the "hard" values of B6, and the Lookup criteria where they need to be. When I select and drag to copy, however, Excel changes the relative values to match the new rows, so I end up with this:

=IF(P32=1, LOOKUP(B13,AH11:AH14,AJ11:AJ14),LOOKUP(P32,AH11:AH14,AJ11:AJ14))
=IF(P33=1, LOOKUP(B13,AH11:AH14,AJ11:AJ14),LOOKUP(P33,AH11:AH14,AJ11:AJ14))
=IF(P34=1, LOOKUP(B13,AH11:AH14,AJ11:AJ14),LOOKUP(P34,AH11:AH14,AJ11:AJ14))

and so on - the drag/copy doesn't maintain my lookup references.

Is there some way to tell Excel to copy my formulas down differently, to maintain my lookup values better? I can do a Find/Replace, but it's a painful process, and for an upcoming project I'm going to have to build quite a few formulas that would be similar
0
Comment
1 Comment
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 0 total points
ID: 37734909
Hmmm ... guess I should RTFM before posting.

You can maintain "absolute references" by using the $ in front of the reference:

$A1 maintains the column, but changes the Row
A$1 maintains the row, but changes the Column
$A$1 maintains both column and row
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question