ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to find #ref! invalid cell references within cell formula (https://www.excelbanter.com/excel-worksheet-functions/243728-how-find-ref-invalid-cell-references-within-cell-formula.html)

Brotherharry

how to find #ref! invalid cell references within cell formula
 
I have a formula in a spreadie used by a variety of people that
occasionally becomes corrupted due to cells being deleted improperly
and the cell references being replaced by #ref!.
The formula still generates a valid result, but it's the wrong one
because it's not looking at the correct data because of the corrupted
references.
e.g.
=IF((ISNUMBER(#REF!)),#REF!,(IF((R3134=0),N3134,N3 134/R3134)))

This means that what superficially appears to be a functioning
spreadie actually has flaws as the formulas aren't generating correct
results. What I need is a quick way to spot formulas that contain
#REF.

The FIND function won't work as presumably it's only looking in the
result of a formula, not the actual formula itself.

ExcelBanter AI

Answer: how to find #ref! invalid cell references within cell formula
 
To find #REF! invalid cell references within cell formula, you can use the "Error Checking" feature in Excel. Here are the steps:
  1. Select the cell or range of cells that you want to check for errors.
  2. Click on the "Formulas" tab in the ribbon.
  3. Click on the "Error Checking" button in the "Formula Auditing" section.
  4. Excel will display a dialog box with a list of errors found in the selected cells. Look for the error "Invalid cell reference error (#REF!)".
  5. Click on the error to see the details of the error, including the cell reference that is causing the error.
  6. Click on "Trace Error" to see the cells that are dependent on the cell with the error.
  7. Correct the error by updating the cell reference or deleting the formula if it is no longer needed.

By using the "Error Checking" feature, you can quickly identify and correct any #REF! errors in your formulas, ensuring that your spreadsheet is accurate and reliable.

Brotherharry

how to find #ref! invalid cell references within cell formula
 

hmm, if I use the worksheet Ctrl+F find dialog, I can search for #REF!
which will pick it up, but the issue is I don't know that I need to do
it if the formulas are otherwise producing numeric results

Stefi

how to find #ref! invalid cell references within cell formula
 
EditFindEnter #REF! in the Find what fieldOptionsLook in: Select
Values!Click Find All!

Regards,
Stefi



€˛Brotherharry€¯ ezt Ć*rta:

I have a formula in a spreadie used by a variety of people that
occasionally becomes corrupted due to cells being deleted improperly
and the cell references being replaced by #ref!.
The formula still generates a valid result, but it's the wrong one
because it's not looking at the correct data because of the corrupted
references.
e.g.
=IF((ISNUMBER(#REF!)),#REF!,(IF((R3134=0),N3134,N3 134/R3134)))

This means that what superficially appears to be a functioning
spreadie actually has flaws as the formulas aren't generating correct
results. What I need is a quick way to spot formulas that contain
#REF.

The FIND function won't work as presumably it's only looking in the
result of a formula, not the actual formula itself.


Luke M

how to find #ref! invalid cell references within cell formula
 
I believe you meant "Look in: formulas", as the value of OP's formula will
not be the error.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Stefi" wrote:

EditFindEnter #REF! in the Find what fieldOptionsLook in: Select
Values!Click Find All!

Regards,
Stefi



€˛Brotherharry€¯ ezt Ć*rta:

I have a formula in a spreadie used by a variety of people that
occasionally becomes corrupted due to cells being deleted improperly
and the cell references being replaced by #ref!.
The formula still generates a valid result, but it's the wrong one
because it's not looking at the correct data because of the corrupted
references.
e.g.
=IF((ISNUMBER(#REF!)),#REF!,(IF((R3134=0),N3134,N3 134/R3134)))

This means that what superficially appears to be a functioning
spreadie actually has flaws as the formulas aren't generating correct
results. What I need is a quick way to spot formulas that contain
#REF.

The FIND function won't work as presumably it's only looking in the
result of a formula, not the actual formula itself.


Brotherharry

how to find #ref! invalid cell references within cell formula
 
It's a solution, but doesn't solve my problem that you have to 'know'
there's a problem that you need to do a Ctrl+F find. If the values
look normal, then a user won't 'know' they need to do the search. I'm
currently using the ISERROR function to pick out that formulas that do
break.

What I need is a way to incorporate the Ctrl+F method into a formula
that sits in the spreadsheet. Once it's generating a value, I can then
use the output to custom format or take some other action to alert the
user that there is an issue.
e.g. stick my magic formula in the last column of a row. get it to
look at all the cells in it's row for #REF! instances. If it finds one
it returns "problem" into the cell it's in. I can then custom format
the whole row to check if that cell contains "problem" and shade all
the cells red.....
eg. =IF((checkforbadrefs(A1:Z1)=TRUE),"problem","no bad refs found")

Stefi

how to find #ref! invalid cell references within cell formula
 
I was also surprised but #REF! error value was found in VALUES and NOT in
formulas. But if you think it over, it's logical: the formula doesn't CONTAIN
the error value, it just returns it.

Stefi


€˛Luke M€¯ ezt Ć*rta:

I believe you meant "Look in: formulas", as the value of OP's formula will
not be the error.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Stefi" wrote:

EditFindEnter #REF! in the Find what fieldOptionsLook in: Select
Values!Click Find All!

Regards,
Stefi



€˛Brotherharry€¯ ezt Ć*rta:

I have a formula in a spreadie used by a variety of people that
occasionally becomes corrupted due to cells being deleted improperly
and the cell references being replaced by #ref!.
The formula still generates a valid result, but it's the wrong one
because it's not looking at the correct data because of the corrupted
references.
e.g.
=IF((ISNUMBER(#REF!)),#REF!,(IF((R3134=0),N3134,N3 134/R3134)))

This means that what superficially appears to be a functioning
spreadie actually has flaws as the formulas aren't generating correct
results. What I need is a quick way to spot formulas that contain
#REF.

The FIND function won't work as presumably it's only looking in the
result of a formula, not the actual formula itself.


Brotherharry

how to find #ref! invalid cell references within cell formula
 
Found a solution via a vb guru I know.

1. create a custom function in vb to convert all the formulas in a
given range into one long text string

Function ConcatFormulas(InputRange As Range)
' this function works to get all the formulas in a specified range,
' then concatenate their text together into one string
' you can then use the FIND function on the string to check for
problems.
Dim i As Integer
For i = 1 To InputRange.Cells.Count
ConcatFormulas = ConcatFormulas & InputRange(i).Formula
Next i
End Function


2. you can then call the function in the spreadsheet e.g.
=ConcatFormulas(A1:Z21)

3. run a find on the result to look for #REF!
=IF((ISERROR(FIND("#REF!",ConcatFormulas(A1:Z1)))) ,"ok","doh!")
The above basically says, merge all the formulas into one string, then
try and find the characters #REF!. if excel can't find an instance of
#REF!, everything is Ok.



All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com