How to lock cell reference when using EXACT fx

Rainbows8

New Member
Joined
Apr 21, 2014
Messages
12
Hi all,

I have a spreadsheet that evaluates cells against eachother and if they don't match I either delete the whole row, or delete up. When I do this, I have to redo the formula as I get an error.

So I start with: =EXACT(A1,G1).... and once I delete a row or delete "up", I get =EXACT(#REF!,$G3).

I have tried =EXACT(INDIRECT(A1,G1)), =EXACT(INDIRECT($A1,$G1)), and also =EXACT($A1,$G1).

None of these work.
Please can someone help me? :confused:

Thank you
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
=EXACT($A1,$G1)

and deleting a complete row works as it readjusts.. if you delete just parts then you can destroy the reference i.e delete A1 0r G1 and we have the error
 
Upvote 0
Assuming your formula is contained in Row_2, try this structure formula
Code:
D2: =EXACT(INDEX(A:A,ROW()-1),INDEX(G:G,ROW()-1)
Now, even if the referenced cells/rows are deleted...the formula will automatically reference the same relative cells.

Adjust the "-1" based on where your formula is located relative to the cells to be referenced.

Is that something you can work with?
 
Upvote 0
Assuming your formula is contained in Row_2, try this structure formula
Code:
D2: =EXACT(INDEX(A:A,ROW()-1),INDEX(G:G,ROW()-1)
Now, even if the referenced cells/rows are deleted...the formula will automatically reference the same relative cells.

Adjust the "-1" based on where your formula is located relative to the cells to be referenced.

Is that something you can work with?


@Ron Coderre, no because my goal is to compare two lengthy lists to ensure each item matches, when they don't, I remove that cell: e.g.

Cell#..A...B... C
1..... 1...1...=EXACT(A1,B1)
2..... 2...3...=EXACT(A2,B2)
3..... 3...3...=EXACT(A3,B3)

now, let's say I want to delete "up" cell A2 to correct an issue... the EXACT fx gets messed up and doesn't know where to reference. Is there a way to make the formula not relative but static, so that A2 will always reference A2, even if I delete that cell "upwards"....
 
Upvote 0
This regular formula always compares A1 to B1...even if either or both of those cells is deleted up.
Code:
C1: =EXACT(INDEX(A:A,ROW()),INDEX(B:B,ROW())
Copy that formula down as far as you need.
 
Last edited:
Upvote 0
Not sure I understand what you are doing, but consider =EXACT(INDIRECT("A1"),INDIRECT("G1"))

Hi all,

I have a spreadsheet that evaluates cells against eachother and if they don't match I either delete the whole row, or delete up. When I do this, I have to redo the formula as I get an error.

So I start with: =EXACT(A1,G1).... and once I delete a row or delete "up", I get =EXACT(#REF!,$G3).

I have tried =EXACT(INDIRECT(A1,G1)), =EXACT(INDIRECT($A1,$G1)), and also =EXACT($A1,$G1).

None of these work.
Please can someone help me? :confused:

Thank you
 
Upvote 0
@Ron Coderre, no because my goal is to compare two lengthy lists to ensure each item matches, when they don't, I remove that cell: e.g.

.

That explains why the ref is wrong as you are deleting cells with that formula

Rons =EXACT(INDEX(A:A,ROW()),INDEX(G:G,ROW())) does what you need
 
Upvote 0
=EXACT($A1,$G1)

and deleting a complete row works as it readjusts.. if you delete just parts then you can destroy the reference i.e delete A1 0r G1 and we have the error

@mole999 - makes sense, is there a way around the error? (see my answer to ron)
 
Upvote 0
=EXACT(INDEX(A:A,ROW()),INDEX(G:G,ROW()))

Rons Answer
 
Upvote 0

Forum statistics

Threads
1,215,079
Messages
6,123,000
Members
449,092
Latest member
masterms

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top